100% found this document useful (1 vote)
892 views

Contoso Sample DAX Formulas

This document provides sales data by country and time period. It includes current period sales, month-to-date sales, quarter-to-date sales, year-to-date sales, and sales from last year and the prior year by month and quarter.

Uploaded by

Kirk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
892 views

Contoso Sample DAX Formulas

This document provides sales data by country and time period. It includes current period sales, month-to-date sales, quarter-to-date sales, year-to-date sales, and sales from last year and the prior year by month and quarter.

Uploaded by

Kirk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 19

2011 Microsoft Corporation. All rights reserved.

Microsoft SQL Server PowerPivot for Excel 2010 workbook samples are provided for informational purposes only as an aid
companies, organizations, products, domain names, e-mail addresses, people, places, and events depicted herein are fic
person, place, or event is intended or should be inferred.

Sample DAX Formulas powered by PowerPivot


Note: This workbook is a companion to the Data Analysis Expressions (DAX) In the Tabular BI Sema

Sales Column Labels


This shape represents a slicer. Row Labels $ 2,007.00
Slicers can be used in at least Armenia $ 10,697,642.89
Excel 2010.
Australia $ 31,698,751.16
If the shape was modified in an Bhutan $ 11,011,949.91
earlier version of Excel, or if the Canada $ 108,076,080.27
workbook was saved in Excel China $ 462,428,507.84
2003 or earlier, the slicer cannot
Denmark $ 10,711,449.83
be used.
France $ 248,801,472.44
Germany $ 354,436,723.97
Greece $ 10,662,152.52
India $ 31,834,758.18
Iran $ 21,314,190.11
Ireland $ 10,570,530.05
Italy $ 34,719,790.81
Japan $ 56,801,779.57
Kyrgyzstan $ 10,913,951.79
Malta $ 10,572,691.21
Pakistan $ 11,992,037.52
Poland $ 10,733,699.68
Portugal $ 10,629,143.02
Romania $ 10,900,048.39
Russia $ 42,189,724.14
Singapore $ 10,262,476.73
Slovenia $ 10,552,250.44
South Korea $ 11,322,555.08
Spain $ 10,775,770.69
Sweden $ 10,511,963.13
Switzerland $ 10,515,133.82
Syria $ 14,010,740.05
Taiwan $ 10,582,040.28
Thailand $ 11,138,010.00
the Netherlands $ 10,700,622.10
Turkmenistan $ 20,877,985.35
United Kingdom $ 151,571,280.23
United States $ 2,767,423,051.84
Grand Total $ 4,561,940,955.02
or informational purposes only as an aid to illustrate a concept. These samples are provided as is without warranty of any kind. The ex
aces, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail ad

d by PowerPivot
ons (DAX) In the Tabular BI Semantic Model whitepaper that was downloaded with the PowerPivot Samples pack

$ 2,008.00 $ 2,009.00 Grand Total


$ 12,802,000.68 $ 13,768,349.90 $ 37,267,993.47
$ 39,734,710.75 $ 41,128,813.37 $ 112,562,275.29
$ 12,899,605.66 $ 19,962,257.73 $ 43,873,813.31
$ 79,570,342.19 $ 63,002,636.49 $ 250,649,058.95
$ 581,050,628.40 $ 617,126,191.03 $ 1,660,605,327.27
$ 5,693,881.55 $ 5,130,625.49 $ 21,535,956.86
$ 218,612,439.39 $ 191,508,610.33 $ 658,922,522.17
$ 337,419,209.63 $ 325,462,497.82 $ 1,017,318,431.42
$ 5,744,113.96 $ 5,049,809.47 $ 21,456,075.94
$ 39,621,943.29 $ 40,462,377.31 $ 111,919,078.79
$ 26,804,288.38 $ 27,098,480.82 $ 75,216,959.32
$ 5,916,233.23 $ 4,962,315.77 $ 21,449,079.05
$ 23,229,095.53 $ 20,541,708.18 $ 78,490,594.52
$ 82,804,472.58 $ 96,818,245.96 $ 236,424,498.11
$ 12,880,870.84 $ 13,804,578.11 $ 37,599,400.74
$ 5,781,747.66 $ 4,921,696.16 $ 21,276,135.02
$ 26,044,576.10 $ 26,279,344.58 $ 64,315,958.20
$ 6,023,341.08 $ 4,693,341.12 $ 21,450,381.88
$ 5,911,127.59 $ 4,910,978.97 $ 21,451,249.58
$ 5,827,158.89 $ 4,950,364.81 $ 21,677,572.09
$ 31,289,351.16 $ 27,870,158.03 $ 101,349,233.33
$ 12,832,977.51 $ 13,167,637.07 $ 36,263,091.30
$ 5,702,422.82 $ 4,862,182.32 $ 21,116,855.58
$ 16,008,692.46 $ 25,809,600.08 $ 53,140,847.62
$ 5,713,579.13 $ 4,896,696.91 $ 21,386,046.72
$ 5,688,176.23 $ 4,817,243.12 $ 21,017,382.48
$ 5,496,527.34 $ 4,785,769.58 $ 20,797,430.75
$ 26,405,490.76 $ 26,299,843.29 $ 66,716,074.09
$ 13,364,330.92 $ 13,663,685.18 $ 37,610,056.38
$ 15,767,761.44 $ 25,970,356.17 $ 52,876,127.61
$ 5,916,178.50 $ 4,781,201.86 $ 21,398,002.46
$ 25,693,638.02 $ 27,240,861.29 $ 73,812,484.67
$ 89,253,182.30 $ 73,230,693.92 $ 314,055,156.45
$ 2,317,729,438.70 $ 1,951,503,966.95 $ 7,036,656,457.48
$ 4,111,233,534.68 $ 3,740,483,119.18 $ 12,413,657,608.89
rranty of any kind. The example
t, domain name, e-mail address,

erPivot Samples package.


FullDateLabel 2008-11-06

PeriodSales Column Labels


Row Labels Current MTD QTD
Armenia $ 22,719.10 $ 248,331.06 $ 1,156,455.96
Australia $ 128,067.97 $ 754,890.40 $ 3,833,540.60
Bhutan $ 80,767.38 $ 309,988.64 $ 1,365,832.64
Canada $ 258,507.69 $ 1,518,548.05 $ 7,951,773.75
China $ 1,960,269.12 $ 11,435,001.27 $ 58,193,897.11
Denmark $ 24,058.13 $ 86,489.48 $ 556,264.15
France $ 534,727.83 $ 3,142,548.57 $ 19,126,666.40
Germany $ 790,463.32 $ 5,349,917.19 $ 29,894,862.89
Greece $ 14,825.29 $ 98,766.16 $ 508,777.15
India $ 145,142.92 $ 947,900.05 $ 4,134,043.95
Iran $ 113,727.40 $ 549,733.95 $ 2,745,800.45
Ireland $ 9,604.36 $ 68,044.98 $ 471,300.18
Italy $ 57,269.06 $ 312,316.79 $ 2,003,178.81
Japan $ 335,623.95 $ 1,612,262.11 $ 9,101,248.61
Kyrgyzstan $ 29,197.23 $ 241,120.89 $ 1,182,001.79
Malta $ 10,835.82 $ 101,050.11 $ 484,124.23
Pakistan $ 60,632.03 $ 483,878.94 $ 2,488,641.64
Poland $ 11,458.66 $ 74,436.33 $ 506,250.72
Portugal $ 14,334.08 $ 82,543.34 $ 484,634.14
Romania $ 17,723.25 $ 66,079.14 $ 525,918.46
Russia $ 86,186.33 $ 465,536.59 $ 2,835,177.26
Singapore $ 37,230.23 $ 239,294.80 $ 1,366,388.10
Slovenia $ 6,053.14 $ 67,655.22 $ 515,804.59
South Korea $ 115,497.14 $ 586,588.21 $ 2,195,931.81
Spain $ 7,424.22 $ 62,314.85 $ 542,951.52
Sweden $ 10,825.89 $ 100,257.62 $ 552,792.58
Switzerland $ 15,828.90 $ 76,134.19 $ 539,348.95
Syria $ 99,356.58 $ 561,511.99 $ 2,782,439.19
Taiwan $ 65,239.47 $ 265,102.72 $ 1,197,816.42
Thailand $ 71,387.79 $ 303,438.03 $ 1,352,993.23
the Netherlands $ 20,163.02 $ 88,269.88 $ 496,320.59
Turkmenistan $ 70,843.13 $ 506,092.99 $ 2,721,339.79
United Kingdom $ 182,761.57 $ 1,349,656.65 $ 7,843,482.31
United States $ 7,243,699.83 $ 45,180,219.48 $ 231,934,288.58
Grand Total $ 12,652,451.83 $ 77,335,920.68 $ 403,592,288.54
YTD LastYear PriorYearMTD PriorYearQTD
$ 10,630,629.07 $ 25,146.17 $ 212,654.18 $ 1,121,173.78
$ 32,614,830.37 $ 123,828.90 $ 594,496.00 $ 3,275,077.35
$ 10,726,623.28 $ 35,580.58 $ 256,654.47 $ 1,146,825.22
$ 65,464,780.74 $ 320,440.61 $ 2,385,069.46 $ 13,909,862.76
$ 474,725,832.07 $ 1,703,305.66 $ 9,553,621.67 $ 48,655,852.65
$ 4,966,219.04 $ 24,324.00 $ 186,647.84 $ 1,049,505.03
$ 190,614,718.24 $ 733,368.11 $ 3,902,324.75 $ 22,325,363.57
$ 294,086,578.90 $ 900,478.83 $ 5,417,617.79 $ 31,627,285.00
$ 5,009,611.56 $ 26,053.33 $ 154,956.80 $ 1,007,976.85
$ 32,675,490.10 $ 127,248.77 $ 663,696.66 $ 3,320,461.21
$ 22,242,772.41 $ 68,747.42 $ 498,713.35 $ 2,402,221.90
$ 5,128,496.88 $ 11,441.97 $ 151,739.44 $ 894,576.89
$ 20,345,019.58 $ 137,949.27 $ 766,162.56 $ 3,858,977.37
$ 66,678,167.55 $ 278,955.15 $ 1,450,069.13 $ 6,901,243.88
$ 10,540,608.84 $ 17,515.32 $ 178,447.79 $ 1,165,162.69
$ 4,958,191.86 $ 54,636.13 $ 168,741.14 $ 915,389.38
$ 21,331,930.64 $ 18,969.33 $ 295,523.67 $ 1,204,215.77
$ 5,285,672.22 $ 21,541.89 $ 152,947.60 $ 915,702.28
$ 5,063,307.38 $ 17,234.25 $ 145,822.80 $ 895,555.26
$ 5,127,880.37 $ 37,849.58 $ 174,908.23 $ 972,815.37
$ 26,452,867.91 $ 122,695.54 $ 725,110.33 $ 3,828,846.62
$ 10,600,256.67 $ 29,687.13 $ 184,459.04 $ 916,084.49
$ 4,943,752.51 $ 21,943.83 $ 112,196.11 $ 782,683.54
$ 11,464,066.25 $ 31,023.92 $ 191,365.85 $ 1,168,477.75
$ 4,983,481.58 $ 30,555.00 $ 202,156.65 $ 958,462.82
$ 4,991,126.90 $ 17,040.83 $ 119,316.89 $ 928,962.03
$ 4,820,451.51 $ 10,781.70 $ 119,826.58 $ 929,864.82
$ 21,743,896.71 $ 110,583.41 $ 533,118.67 $ 2,260,607.07
$ 10,944,628.77 $ 23,070.76 $ 181,632.04 $ 1,090,788.49
$ 10,998,795.22 $ 26,696.84 $ 210,804.81 $ 1,236,681.21
$ 5,067,609.65 $ 41,799.60 $ 194,285.27 $ 1,109,073.78
$ 21,092,718.97 $ 73,733.64 $ 432,548.65 $ 2,223,602.60
$ 77,462,877.88 $ 404,162.04 $ 2,379,801.38 $ 13,976,171.47
$ 1,902,935,677.29 $ 9,912,907.11 $ 59,461,792.22 $ 336,596,919.75
$ 3,406,719,568.90 $ 15,541,296.62 $ 92,359,229.81 $ 515,572,470.66
PriorYearYTD
$ 8,550,719.20
$ 25,641,432.83
$ 8,910,980.70
$ 89,530,353.64
$ 373,746,351.61
$ 9,245,930.91
$ 215,894,185.56
$ 306,232,736.44
$ 9,167,992.96
$ 25,610,163.15
$ 17,019,930.98
$ 9,032,204.45
$ 28,850,595.54
$ 44,252,537.63
$ 8,886,335.52
$ 9,080,700.62
$ 9,024,564.11
$ 9,318,818.05
$ 9,113,288.82
$ 9,379,389.97
$ 35,783,524.44
$ 8,131,284.97
$ 9,017,071.67
$ 9,134,537.56
$ 9,328,694.78
$ 9,100,484.90
$ 9,050,453.04
$ 10,154,605.48
$ 8,575,057.95
$ 9,157,251.17
$ 9,244,028.64
$ 16,572,968.80
$ 130,067,237.52
$ 2,274,883,019.43
$ 3,774,689,433.03
RegionCountryName Canada
CityName Vancouver
ProductKey (Multiple Items)

IncorrectQty Column Labels


Row Labels 2007 2008 2009
Contoso Vancouver No.1 Store 15 32 13
Contoso 2G MP3 Player E200 Blue 7 11
Contoso 4G MP3 Player E400 Silver 8 21 13
Contoso Vancouver No.2 Store 5 15 16
Contoso 2G MP3 Player E200 Blue 5 15 16
Grand Total 20 47 29
RegionCountryName Canada
CityName Vancouver
ProductKey (Multiple Items)

InventoryQty Column Labels


Grand Total Row Labels 2007
24 Contoso Vancouver No.1 Store 15
11 Contoso 2G MP3 Player E200 Blue 7
13 Contoso 4G MP3 Player E400 Silver 8
16 Contoso Vancouver No.2 Store 5
16 Contoso 2G MP3 Player E200 Blue 5
40 Grand Total 20
2008 2009 2010 2011 Grand Total
32 24 24 24 24
11 11 11 11 11
21 13 13 13 13
15 16 16 16 16
15 16 16 16 16
47 40 40 40 40
Row Labels Sales ColorRank
Azure $51,328,936.53 13
Black $2,721,015,591.94 1
Blue $1,077,572,553.46 5
Brown $580,192,494.76 6
Gold $214,798,389.83 11
Green $545,364,759.33 7
Grey $1,243,103,636.21 4
Orange $374,884,081.18 9
Pink $274,631,376.67 10
Purple $4,245,247.46 15
Red $478,436,368.89 8
Silver $2,152,354,742.10 3
Silver Grey $121,228,292.98 12
Transparent $1,173,767.25 16
White $2,533,782,878.17 2
Yellow $39,544,492.14 14
Grand Total $12,413,657,608.89 1
Row Labels Sales Top3ProductSales Bottom3ProductSales
High $6,734,689,763.77 $106,075,463.69 $131,925.19
Low $2,579,528,111.57 $86,256,616.55 $533,626.60
Mid $3,099,439,733.55 $152,651,739.87 $46,696.90
Grand Total $12,413,657,608.89 $152,651,739.87 $30,607.21
Row Labels Sales Sales_ALL
This shape represents a
slicer. Slicers can be used in High $1,246,004,902.20 $12,413,657,608.89
at least Excel 2010. Low $656,379,560.65 $12,413,657,608.89
Mid $1,201,237,128.45 $12,413,657,608.89
If the shape was modified in Grand Total $3,103,621,591.29 $12,413,657,608.89
an earlier version of Excel, or
if the workbook was saved in
Excel 2003 or earlier, the
slicer cannot be used.
SalesRatio_ALL Sales_ALLSELECTED SalesRatio_ALLSELECTED
10.04 % $3,103,621,591.29 40.15 %
5.29 % $3,103,621,591.29 21.15 %
9.68 % $3,103,621,591.29 38.70 %
25.00 % $3,103,621,591.29 100.00 %
Row Labels Vacation Hours
Pieter Uittenbogaard 14,041
(Pieter Uittenbogaard data) 80
Humberto Acevedo 2,569
Kim Abercrombie 3,218
Kirk Nason 4,611
Luka Abrus 1,874
Sagiv Hadaya 1,689
Grand Total 14,041

You might also like