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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
krodocker
Regular Visitor

Calculated Measure Not Working With Filter

I am trying to calculate the percentage of "Spend" received for each "Item" per "Supplier" using the measure below. (For example, Item A has 60% Spend with Supplier1 and 40% Spend with Supplier2.) This measure calculates correctly until I apply a filter for Item... then all percentages show as 100%. How can I maintain the percentage when applying the filter?

 

Percentage of Spend Received by Supplier Per Item =

DIVIDE(
CALCULATE(SUM(TABLE1[Spend]),

FILTER(TABLE1,TABLE1[Supplier] = TABLE1[Supplier])),

CALCULATE(SUM(TABLE1[Spend]),
ALLSELECTED(TABLE1), TABLE1[Item] IN VALUES(TABLE1[Item])))

3 REPLIES 3
az38
Community Champion
Community Champion

Hi @krodocker 

TABLE1[Supplier] = TABLE1[Supplier]

it is a very strange condition for any filter, doesn't it? it will return you all the table 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Pragati11
Super User
Super User

Hi @krodocker ,

 

Try modifying yourcalculation to:

DIVIDE(
           CALCULATE(SUM(TABLE1[Spend]), FILTER(ALLSELECTED(TABLE1),TABLE1[Supplier] = TABLE1[Supplier])),

           CALCULATE(SUM(TABLE1[Spend]), ALLSELECTED(TABLE1), TABLE1[Item] IN VALUES(TABLE1[Item]))

           )

 

Let me know if this works.

 

Thanks.

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Stachu
Community Champion
Community Champion

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1Column2
A1
B2.5

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.