Ms Excel: Essential Training For The 70-779 EXAM
Ms Excel: Essential Training For The 70-779 EXAM
ESSENTIAL
TRAINING FOR THE
70-779 EXAM
ADVANCED
DAX/MDX FORMULAS
CALCULATE FUNCTION
1 3
4 Filters used to set the context for the expression in the CALCULATE function
1 3
4 ALL(mortgages)
4 USERELATIONSHIP(customers[OfferDate], Calendar[Date])
1 2 3
4 Forces context to be the entire table, regardless of implicit context from the Pivot Table
1 2 3 4
4 Equivalent filters using different functions; both reference our calendar table
1 2
YOYGrowth := IF( ISBLANK([SalesLastYear]) , BLANK(), [TotalCost]/[SalesLastYear])
YOYGrowth := DIVIDE( [TotalCost] , [SalesLastYear])
3
1 2
RunningTotalSales := CALCULATE( [TotalCost], FILTER( ALL(Calendar[Date]),
Calendar[Date] <= MAX(Calendar[Date]) ) )
3
1 FILTER() function returns a table that is filtered for each filter condition you provide
2 ALL() function gets every date possible to act as your base table
3 Date comparison (current date to maximum date) filters down the entire table from ALL() to return only the values leading
up to the date of the current row in context
1 3
=CUBEVALUE(“ThisWorkbookDataModel”, $A23, B$14, Slicer_Date_Hierarchy)
2 4
1 CUBEVALUE() tells Excel to get the value associated with parameters/members you pass
1
=CUBEVALUE("ThisWorkbookDataModel",CUBEMEMBER("ThisWorkbookDataModel“
,"[mortgages].[LoanConsultant].[Ricky Zobrist]"), B$1, Slicer_Year)
2 3 4
1 Rather than a cell reference, you can hard-code the value you want with CUBEMEMBER
2 Declare a table or Measures in your model first; ex. [mortgages]; ex. [Measures]