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
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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft, 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?

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, @v-yiruan-msft 

 

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 @v-yiruan-msft , 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
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.

Top Solution Authors