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 August 31st. Request your voucher.

Reply
orghn
Helper I
Helper I

Error on measure + slicer

Hi, I attach a sample file where I have the issue:

 

https://www.dropbox.com/s/okd4v27jqk1ddt0/Sample.pbix?dl=0

 

I need to show in each empty cell, the price of the lab i selected. In this case, 1600 for each and so the Dif metric that divide my price/total Prod

orghn_0-1643204822029.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @orghn ,

I updated your sample pbix file(see attachment), please check whether it can help you get the expected result. 

1. Update the measure [My_Price] as below

My_Price = 
CALCULATE (
    SUM ( 'Price'[Price] ),
    FILTER (
        ALLSELECTED ( 'Price' ),
        'Price'[Month] IN ALLSELECTED ( 'Price'[Month] )
    )
)

2. Update the measure [Total_Prod_Price] as below

Total_Prod_Price = CALCULATE ( SUM ( 'Price'[Price] ), REMOVEFILTERS ( 'Lab'[Lab Name] ) )

yingyinr_0-1643693982818.png

Best Regards

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @orghn ,

I updated your sample pbix file(see attachment), please check whether it can help you get the expected result. 

1. Update the measure [My_Price] as below

My_Price = 
CALCULATE (
    SUM ( 'Price'[Price] ),
    FILTER (
        ALLSELECTED ( 'Price' ),
        'Price'[Month] IN ALLSELECTED ( 'Price'[Month] )
    )
)

2. Update the measure [Total_Prod_Price] as below

Total_Prod_Price = CALCULATE ( SUM ( 'Price'[Price] ), REMOVEFILTERS ( 'Lab'[Lab Name] ) )

yingyinr_0-1643693982818.png

Best Regards

Hi @Anonymous, Thanks!! That`s working. The only point is that if I want to show 2 month in the table, it SUM the values for both month in the my_price measure. Is there any way to fix it?

Anonymous
Not applicable

Hi @orghn ,

I updated your sample pbix file(see attachment) again, please check whether that is what you want.

1. Update the measure [My Price] as below to get it.

My_Price = 
CALCULATE (
    SUM ( 'Price'[Price] ),
    ALLEXCEPT ( 'Price', 'Price'[Month] ),
    FILTER (
        ALLSELECTED ( 'Lab' ),
        'Lab'[Lab Name] IN ALLSELECTED ( 'Lab'[Lab Name] )
    )
)

2. Drag Month field of table Price onto the table visual

yingyinr_0-1643770164972.png

Best Regards

Hi, @Anonymous 

 

I attach a new sample file with more than 1 product per lab
https://www.dropbox.com/s/jh9ctxatt079dvq/Sample%28Updated2%29%20%281%29.pbix?dl=0

The issue is that when I have more than 1 product for a lab, it SUM each value.
I tried many things but doesnt work. Thanks for your help!

Hi @Anonymous , I tried but still not working. I attach my real file, maybe this can help.

https://www.dropbox.com/s/u9ll534jeox7efu/Sample%20Real.pbix?dl=0

ValtteriN
Super User
Super User

Hi,

Something like this should work:

CALCULATE(SUM(Table[My price],ALLEXCEPT(Table,Table[Lab Name]))





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

Proud to be a Super User!




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.