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

Stop ALL function being filtered by a slicer

Feeling like I am missing something simple here...

 

I'm using the ALL function with a simple sum measure to stop the filtering of the 'Status' column:

 

Cost = Sum('Cost table'[Cost])

 

All Cost = [Cost](ALL('Cost table'[Status]))

 

However if I have a slicer for 'Status' on the page it will still filter the measure according to the slicer.

 

E.g. 

 

Cost      Status

10          Live

10          Closed

 

If I have a slicer for Status on the page and select only 'Live', I would expect the out come of the formula to still be 20, however I am getting 10.

 

Anybody know what I am missing?

 

The out come i am trying to achieve in the above scenario would be to display a card with the result of 50% i.e. [cost]/[all cost] = 10 / 20 = 50%, which cannot be done by simply turning off cross filtering in the 'Edit Interactions' menu...

1 REPLY 1
konstantinos
Memorable Member
Memorable Member

Your formulas are correct but...the cost formula that you have in the table behaves as it suppose to be. If you add the formula All cost in the table it should show 20..The are different formulas..so the devide will be Cost = 10 /  All Cost = 20 result = 0,5 or you can combine it to one

 

One formula

 

Cost Ratio = Var Cost = SUM('Cost Table'[Cost])

Var AllCost = CALCULATE( SUM('Cost Table'[Cost]);ALL('Cost Table'[Status]))
Return

DIVIDE( Cost ; AllCost )

 

With three measures 

Cost = SUM('Cost Table'[Cost])



All Cost = CALCULATE( SUM('Cost Table'[Cost]);ALL('Cost Table'[Status]))

Cost Ratio = [Cost] / [All cost ]

or if you expect zero values on cost 

Cost Ratio = Divide ( [Cost];[All Cost])

( I am using semicolon which you might use dot )

 

 

Either way is correct..and the slicer selection on status don't affect the result 

 

Untitled.png

 

 

 

 

Konstantinos Ioannou

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.