Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
a_gaisin
Frequent Visitor

ALL doesn't work as expected

Hello, I'm trying to understand how dax ALL function works. I have a toy dataset

capture26_5_1.PNG

, 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: Capture26_5_2.PNG

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.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Looking at the DAX query that the matrix visual produces... It's not possible to do what you want to do.

Best
D

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

You 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
harshnathani
Community Champion
Community Champion

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 Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

@harshnathani @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.

Anonymous
Not applicable

[Row Count] = COUNTROWS( 'Table' ) + 0

 

Best

D

@Anonymous thank you for response, I tried it already, and it doesn't work. Capture27_5_0.PNG

Anonymous
Not applicable

Looking at the DAX query that the matrix visual produces... It's not possible to do what you want to do.

Best
D

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors