Forum Discussion
ALL doesn't work as expected
Hello, I'm trying to understand how dax ALL function works. I have a toy dataset
, and a matrix visual in Power BI with "projet id" on rows, and "nature" on columns, and measure "Count" on values. The code of the measure is the following:
Count = COUNTROWS(ALL('Table'))
Here's the result that I have:
It's quite unexpected, because I thought that I will get 7's everywhere, because ALL will remove all the filters. But as you can see there are several blank cells.
How do I make all cells equal to 7?
Thank you.
- Anonymous6 years agoLooking at the DAX query that the matrix visual produces... It's not possible to do what you want to do.
Best
D
6 Replies
- AnonymousNot applicable
Hi a_gaisin ,
Not sure what you want to acheive.
Values are blank as there is no entry for IYEJ...... against nature =1 and so on.
Incase you want all 7, you will need to add the entries in the source file.
By the way, wht is the end goal.
Regards,
Regards,
Harsh NathaniDid I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
- a_gaisinFrequent Visitor
Anonymous Anonymous the initial example was quite artificial. Let me explain what I'm really trying to do. For each (project,nature) pair I want my measure to output the number of times it presents in the Table. For example, there's only one line corresponding to pair (0GWS..., 1) in the Table, and there's no lines corresponding to (1YEJ...,1). So, in the first case measure should output 1, and in the other - 0. Is there a way to do that? Thank you.
- AnonymousNot applicable
[Row Count] = COUNTROWS( 'Table' ) + 0Best
D
- AnonymousNot applicableYou will know why you don't get 7 everywhere if you open DAX Studio and intercept the query that your visual generates and sends to the calculation engine.
You'll understand this result immediately.
Best
D