Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

Composable DAX Table Functions

CALCULATE() AND CALCULATETABLE() are the only two functions for manipulating filter context (adding to, replacing, or ignoring other filters) so these have to be at the top of my list but it's the functions you pass to them as filter arguments, and sometimes the functions within these functions, that really unleashes the power of DAX.


ALL() is often one of these common filter arguments as you want your expression to ignore a filter on a particular column, the entire table, or all columns in the table except a few columns (use ALLEXCEPT() function) .


FILTER() is another very common argument function for CALCULATE() that enables you to pass in a 'rich' filter argument such as a measure which isn't allowed by CALCULATE or CALCULATETABLE() alone.


So you'll often see expressions like the following:


MyMetric:= CALCULATE([MetricA],FILTER(ALL(Product),[MySalesMetric] > 500))


In this case we want to modify the filter context applied to Metric A - we want to remove all filters on the Product table via ALL but then filter the rows of this full table (one by one, iterating with FILTER) by a metric (MySalesMetric) such that only rows with over 500 are included. This final, modified Product table is used via relationship to your Fact table (of MetricA) to filter out its rows and then compute MetricA.


VALUES() is very important and flexible as well for working with individual columns. Values - Power Pivot Pro


The new CROSSFILTER function will be extremely useful for working with complex models. (Bidirectional and CrossFilter White Paper)


Variables (VAR) and the new INTERSECT, EXCEPT, and UNION functions will greatly simplify and sometimes improve performance of DAX code as well.














Helpful resources

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!