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
Anonymous
Not applicable

ALL fails to clear filter context from row header

Hi,

 

I noticed a strange behaviour of ALL function. Sometimes it fails to clear filter context from row header, as shown in the screenshot below:

Capture.JPG

Click this link to download the model.

 

Could anyone please explain why ALL works on [Month] but not [Month Name]?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Angelia,

 

I think the answer to my question is in this post. It's due to how DAX deals with sorted column.

View solution in original post

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

In your data table, the [Month Name] is based on [Month] column, so you need to ALL([Month]) in your formula. I create the measures using the formula below, and get expected result.

Max Date 2_test = CALCULATE(MAX(Calendar[Date]),ALL('Calendar'[Month]),ALL('Calendar'[Month Name]))

Row Count 2_test = CALCULATE(COUNTROWS('Calendar'),ALL('Calendar'[Month]),ALL('Calendar'[Month Name]))


4.PNG

Or you create [Month Name] using Calendar[Date] column rather than [Month] column. I create a calculated column using the formula.

month/name = FORMAT('Calendar'[Date],"MMM")&" "&YEAR('Calendar'[Date])

Max date = CALCULATE(MAX('Calendar'[Date]),ALL('Calendar'[month/name]))

Row Count = CALCULATE(COUNTROWS('Calendar'),ALL('Calendar'[month/name]))


5.PNG

Please download the .pbix file for further analysis.

Best Regards,
Angelia

Anonymous
Not applicable

Hi Angelia,

 

I think the answer to my question is in this post. It's due to how DAX deals with sorted column.

Anonymous
Not applicable

Hi Angelia,

 

Thank you for your reply. Could you please explain why ALL('Calendar'[Month Name]) by itself doesn't remove the filter context from row header? Why does ALL differentiate calculated columns based on an original column or another calculated column?

 

According to DAX Function Reference, ALL "Removes all filters from the specified columns in the table". It doesn't say ALL treats different types of columns differently. I found it very hard to use what's in the reference to explain what I observed in my attached model.

 

 

 

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.