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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sanimesa
Post Prodigy
Post Prodigy

Help with a calculated measure filtered on a column and slicer on same column

I have a very simple example table - purchases from vendors with item number, vendor name, amount and a paid flag (yes/no).

 

I have a measure that calculates the total amount:

Total Cost = SUM(Purchases[Cost])
 
A measure that calculates the total for paid line items:
Total Paid = CALCULATE([Total Cost], Purchases[Paid]="Yes")
 
% Paid = DIVIDE([Total Paid], [Total Cost])
 
I added two filters, one for the vendor, one for the Paid flag. I would expect when I select Paid=No, then the % Paid would be zero. This is not happening. When Paid=Yes, % Paid is correctly shown as 100%. The company fflter is working as expected. 
 
The pbix file is attached.
 
 
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@sanimesa ,

try this measure for Total Paid:

Total Paid =
CALCULATE ( [Total Cost], FILTER ( Purchases, Purchases[Paid] = "Yes" ) )

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@sanimesa ,

try this measure for Total Paid:

Total Paid =
CALCULATE ( [Total Cost], FILTER ( Purchases, Purchases[Paid] = "Yes" ) )

@Anonymous Thanks a lot, this worked. Why does this work and not the other way around?

Anonymous
Not applicable

@sanimesa,

The original Total Paid measure is overriding the filter context coming from your slicer, essentially it is equivalent of the following formula:

Total Paid = 
CALCULATE ( [Total Cost], FILTER ( ALL ( Purchase[Paid] ), Purchase[Paid] = "Yes" ) )

ALL function ignore any filters coming from your data model. See reference here

@Anonymous Makes sense, thanks. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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