Ravindra BagaleCourses & study guides

32. Keyboard Shortcuts and DAX Cheat Sheet

32.3 Common Measure Patterns (Copy & Adapt)

Total Orders    = DISTINCTCOUNT(Orders[Order ID])
AOV             = DIVIDE([Total Sales], [Delivered Orders])
Cancel Rate     = DIVIDE([Cancelled Orders], [Total Orders])
Avg Deliv Mins  = AVERAGEX(VALUES(Orders[Order ID]),
                      CALCULATE(MAX(Orders[Delivery Time Mins])))
% Under 10 Mins = DIVIDE(CALCULATE([Delivered Orders],
                      Orders[Delivery Time Mins] <= 10), [Delivered Orders])
% of Total      = DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Product)))
Sales LY        = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
YoY %           = DIVIDE([Total Sales] - [Sales LY], [Sales LY])
Sales YTD       = TOTALYTD([Total Sales], 'Date'[Date])
Running Total   = CALCULATE([Total Sales],
                      FILTER(ALL('Date'[Date]), 'Date'[Date] <= MAX('Date'[Date])))
Rolling 12M     = CALCULATE([Total Sales],
                      DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH))
Rank            = RANKX(ALL(Product[Product Name]), [Total Sales], , DESC, DENSE)
Top 5 Sales     = CALCULATE([Total Sales], TOPN(5, ALL(Product[Product Name]), [Total Sales]))
Selected Item   = SELECTEDVALUE(DarkStore[City], "All Cities")
Delivered Sales = CALCULATE([Total Sales],
                      USERELATIONSHIP(Orders[Delivered Date], 'Date'[Date]))

Ravindra Bagale's Tip

Mitrano, khup students copy a measure pattern and forget to change the table and column names to match their model. After pasting, read every reference and replace it, then test the measure with a slicer before using it in the report. He exam aani interview doghansathi important aahe.

Thodkyaat sangaycha tar (quick recap)

Roj vaparnar te thodech shortcuts savayit aana, aani pattern copy kelyavar table aani column chi nava tumchya model pramane badla. Aata shevti glossary.