March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi friends,
The more I think I know about dax, the more I realize this is hell on earth :). Help me understand this please.
So I used the Dax Below to get the distinct number of months with records on our timesheet, before the current month. I am basically counting the distinct values on "YearMonth" column.
The thing is that I am using a KPI card, which has a month filter context. Because we are in february, the Table Relatório colapses to a blank register with the measure below. Calendar Table filters Relatório Table.
The result below "should be" 1, because previous to this month there is only January. Now, here is the important part, because I am using ALL (Relatorio), I thought I was getting rid of all the filters in this table - but apparently I am not! Since the problem was solved when I embraced the DAX below with Calculate, expression, Remove filters())
Expression =
Solved! Go to Solution.
Hi,
The problem is likely caused by this part of your DAX:
&& 'Relatório'[Empresa] IN VALUES ( 'Relatório'[Empresa] )
Now the table expression VALUES ( 'Relatório'[Empresa] ) is affected by filters -> if your filters cause this table to be blank it will in turn cause your calculation to fail.
Example of similar DAX:
By slicing the date VALUES('Dateadd-2'[Date]) will return a blank table and thiss will cause everything else to be blank:
If we use ALL instead of VALUES the problem is gone:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Hi,
The problem is likely caused by this part of your DAX:
&& 'Relatório'[Empresa] IN VALUES ( 'Relatório'[Empresa] )
Now the table expression VALUES ( 'Relatório'[Empresa] ) is affected by filters -> if your filters cause this table to be blank it will in turn cause your calculation to fail.
Example of similar DAX:
By slicing the date VALUES('Dateadd-2'[Date]) will return a blank table and thiss will cause everything else to be blank:
If we use ALL instead of VALUES the problem is gone:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Still trying to digest the information. But I sort of understand. And the problem was indeed the the part you mention. Genius!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
15 | |
7 | |
6 |
User | Count |
---|---|
33 | |
29 | |
16 | |
13 | |
12 |