Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am trying to build a measure that removes filters from any table, except for Calendar. I try to do:
= CALCULATE([Sales Amt], ALLEXCEPT(Calendar)
but it requires specific columns.
Maybe this should work?
=CALCULATE([Sales Amt], ALL(), VALUES(Calendar))
or does VALUES also require columns?
Solved! Go to Solution.
In CALCULATE(), tables can be used as filter modifiers; thus you can author DAX formula this way,
= CALCULATE([Sales Amt], ALL(), Calendar)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
In CALCULATE(), tables can be used as filter modifiers; thus you can author DAX formula this way,
= CALCULATE([Sales Amt], ALL(), Calendar)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks!
I've checked and both syntaxes work:
=CALCULATE([Sales Amt], ALL(), VALUES(Calendar))
=CALCULATE([Sales Amt], ALL(), Calendar)
So, what does the values do if used on the whole table?
When a table name is given, VALUES(tablename) returns a table with the same columns and all the rows of the table (including duplicates) with the additional blank row if present.
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi,
I am not sure if I understood your question correctly, but I assume your fact table and a calendar table are connected via [Date] column.
Please try the below measure.
new measure: =
CALCULATE (
[Sales Amt],
ALLEXCEPT ( 'Your fact table', 'Your fact table'[Date] )
)
No, this will not work.
It is not how it works in data models in Power BI
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |