lördag 14 februari 2015

PowerPivot & DAX functions



The step between Excel and DAX functions is surprisingly small.
Print this Summary of DAX functions + cheat sheet + 2016 functions. 95% are the same functions.

New functions RELATED()FILTER(), or here.

Learn via...
Videos: CALCULATE(), Microsoft
Forums: MrExcel, StackOverflow,
Articles: FILTER() vs CALCULATETABLE()DAX Patterns

Extra
DAX Studiocreate measures,
SQL-Server: PowerPivot/DAX in SQL server,
Enabling Tableau to read PowerPivot
To be clear, you are not connecting to the Excel pivot table, but to the underlying PowerPivot model.


CALCULATE()Any FILTER() in a CALCULATE statement overrides the existing PivotTable selection (for the columns it contains). If we don’t want to loose the existing PivotTable selection, we can use VALUES() instead of ALL().


DAX Studio
EVALUATE
Your OutputTable

EVALUATE
ROW ("Result", Your OutputMeasure)

Hidden DAX-editor in Excel
Enables AutoRefresh (histogram example)

Compare SQL, MDX, DAX
Simple example

DAX joins
Measure(SourceValue;ForeignKey) by Dimension(Related;Key)
=INDEX(Source;MATCH(RelatedKey;ForeignKey;0))
=VLOOKUP(ForeignKey;SourceTable;ForeignKey/Col.;0)


Source: Book