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
Adrian89
New Member

Remove filter with All function does not work when "sort by column"

Hi,

I experienced a problem with ALL function when trying to sum up sold value per month and then divide it to get average per month and then use it as a target in KPI visual. 

I used the format function to get Mth "Jan 2016" (FORMAT(Trans[DatePhysical];"mmm yy")) and then I sorted that column by another calculated column so I get the order of month correct. 
When adding fields into the KPI visuals it didn't work I used mth column as Trend Axis and two other Calculated measures into indicators and Target goal. In the calculated measure for the target goal I used the All function to remove the filter from mth.
In Excel PowerPivot the All function would be enough to to use in the Calculate function not to filter.

 

So what I found out was that it's not enough to just use ALL function on the column that you use in the table. You also need to use the ALL function on the "Sort by column" column to remove all filters.

 

As shown in the example below, when using testing5(Example 1) and testing6(Example 2) calculated measure.

Testing5 will remove all filters and give me average per mth and I can use it as a target goal, while testing6 fails.

 

Testing5 = CALCULATE(SUM(Trans[CostAmountPhysical]);ALL(Trans[Mth]);ALL(Trans[Mth seq]))/9

Testing6 = CALCULATE(SUM(Trans[CostAmountPhysical]);ALL(Trans[Mth]))/9

 

Sold per mth1 = CALCULATE(SUM(Trans[CostAmountPhysical]);DATESBETWEEN(Trans[DatePhysical];DATE(2015;09;01);EOMONTH(TODAY();-1)))Example 1, Correct viewExample 1, Correct view

 

Example 2, not workingExample 2, not working  

1 REPLY 1

I have heard of the before - I think it is a bug.  Also you really should be using a calendar table.  Read about that here. 

http://exceleratorbi.com.au/power-pivot-calendar-tables/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.