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
qmestu
Helper III
Helper III

Calculating a measure ignoring slicers

Hi,

 

I have the following table (a simplified example is below). I also have a slicer that can select between the categories A,B,C,D. I'm trying to get the ratio of each category when i change the selected value in the slicer.  For example, selecting A would produce the result of 0.33.



Measure=divide(calculate(sum(table[value]),table[ID]=1),calculate(sum(table[value]),table[ID]=1,table[category]="Total")))

I believe this doesn't work because the slicer takes precedence of the calculation of the measure. I've tried using the ALL function but it didn't work either.

 

IDCategoryValue
1A5
1B5
1C2
1D3
1Total15

 

Thanks for reading and any help you may provide!

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @qmestu 

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We can click "New Measure" to create a measure :

Measure = var _total = CALCULATE(SUM('Table'[Value] ),ALL('Table'))
return
DIVIDE( SUM('Table'[Value]) , _total)

(3)Then we put the fileds we need on the visual , and we will meet your need :

vyueyunzhmsft_0-1667525010278.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @qmestu 

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We can click "New Measure" to create a measure :

Measure = var _total = CALCULATE(SUM('Table'[Value] ),ALL('Table'))
return
DIVIDE( SUM('Table'[Value]) , _total)

(3)Then we put the fileds we need on the visual , and we will meet your need :

vyueyunzhmsft_0-1667525010278.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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.