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
markyochoa
Helper I
Helper I

Is there an efficient way to have multiple slicers to be used in multiple measure calculations?

Here's what I mean:

 

I have 3 different measure calculations I need to do where each of them have a variable percentage that the user can choose from.

 

The slicers in question will have 3 different percentage options to choose from. Reason I need 3 is because the percentages are different for each slicer. There's a slicer that will have 30/20/10 for exampoe. 

Well call this SlicerA:

markyochoa_0-1668102208340.png

 

So the pseudo calc would be:

CalculationA = [Amount]*[SlicerA]

CalculationB = [Amount]*[SlicerB]

CalculationC = [Amount]*[SlicerC]

 

The quickest way for me to do it would be to have 3 different tables for each slicer. So for SlicerA I would have:

 

TableA:

PercentA
.95
.90

.85

 

And repeat the process for SlicerB and C. So the DAX would be:

 

CalculationA = [Amount]*SELECTEDVALUE(TableA[PercentA])

 

And then repeat the process for B and C for their respective percentages.

 

 

Is there a more efficient way to do this?

 

I was hoping I could just do a single table and format it as:

 

TableP

Slicer

Percentage
SlicerA.95
SlicerA.85
SlicerA.80
SlicerB.2
SlicerB.1
SlicerB.05
SlicerC.50
SlicerC.45
SlicerC.30

 

But if I do this I don't think I can used SELECTEDVALUE() and I'm still quite new to DAX so here's where I'm asking for help.

 

 

 

 

Thanks

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

Hi @markyochoa ,

According to your description, here's my solution.

Just create a slicer table like this:

vkalyjmsft_0-1668149041179.png

Here's the formula to get the value selected for slicer category, you can either create seperate measures or directly use the formula in the calculation.

SlicerA =
CALCULATE (
    SELECTEDVALUE ( 'Slicer'[Percentage] ),
    'Slicer'[Slicer] = "SlicerA"
)
SlicerB =
CALCULATE (
    SELECTEDVALUE ( 'Slicer'[Percentage] ),
    'Slicer'[Slicer] = "SlicerB"
)
SlicerC =
CALCULATE (
    SELECTEDVALUE ( 'Slicer'[Percentage] ),
    'Slicer'[Slicer] = "SlicerC"
)

In the slicer, put Slicer and Percentage columns in the field, and the correct result.

vkalyjmsft_1-1668149389151.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @markyochoa ,

According to your description, here's my solution.

Just create a slicer table like this:

vkalyjmsft_0-1668149041179.png

Here's the formula to get the value selected for slicer category, you can either create seperate measures or directly use the formula in the calculation.

SlicerA =
CALCULATE (
    SELECTEDVALUE ( 'Slicer'[Percentage] ),
    'Slicer'[Slicer] = "SlicerA"
)
SlicerB =
CALCULATE (
    SELECTEDVALUE ( 'Slicer'[Percentage] ),
    'Slicer'[Slicer] = "SlicerB"
)
SlicerC =
CALCULATE (
    SELECTEDVALUE ( 'Slicer'[Percentage] ),
    'Slicer'[Slicer] = "SlicerC"
)

In the slicer, put Slicer and Percentage columns in the field, and the correct result.

vkalyjmsft_1-1668149389151.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

 

Thanks! This was simpler than I expected!

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