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
Binkhorst
Frequent Visitor

Function ALL does not work if the column is sorted by another column.

I have a fact table and a date table.  In the date table I have a column for the MonthName. This is a tekst column so I have sorted it by the MonthNumber column to correctly order the months. 

 

I want to calculate an amount in my fact table where I want to ignore the filter on the MonthName. I have used the function ALL for this. However the function does not work when I sort the MonthName by the MonthNumber column. If I do not sort the MonthName then the function works as expected.

 

Is there a work around for this?

1 ACCEPTED SOLUTION

Hi @Binkhorst ,

 

You can and you must use the Month Name on your reports on your measure you must use the MonthNumber.

 

The calculations in measures is based on context so if you pickup a column from a table, in this case Month Name, all the other columns in the same row are pickup based on context also so the Month Name is pick up for your visualizaiton and by the row context the month number is pickup and used in your measure so everything will work properly.

 

There is no need to use only the columns you use on your measure in the visualization the context transcition make it work properly.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
Binkhorst
Frequent Visitor

Thank you, that works perfectly.

MFelix
Super User
Super User

Hi @Binkhorst ,

 

In this case you should always use your base column on your all function, for you model instead of using the

ALL(Table[MonthName])

 

You should use the 

ALL(Table[Month])

 

Since this is in the same table and row the result is the same.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you for your input.  That would mean I cannot use MonthName in my reports and I hoped there would be another solution.

Hi @Binkhorst ,

 

You can and you must use the Month Name on your reports on your measure you must use the MonthNumber.

 

The calculations in measures is based on context so if you pickup a column from a table, in this case Month Name, all the other columns in the same row are pickup based on context also so the Month Name is pick up for your visualizaiton and by the row context the month number is pickup and used in your measure so everything will work properly.

 

There is no need to use only the columns you use on your measure in the visualization the context transcition make it work properly.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.