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! Learn more

Reply
sonuojha1
Helper IV
Helper IV

Slicer to get Multiple selected values

Subject: Slicer to get Multiple selected values and use those values in Variables inside measures

Hi All,

I have a requirement to use slicer's selected multiple values to use to compare different selected measures.

test_slicer.jpg

For example:- user selected two values as above. I want to use these two selected values in a measure to calculate difference between two selected measures.

 

here

1. the first challenge is how to split multiple selected values into two different variables.

2. Then calculate the difference between measure as selected.

 

let say 

Actual This Year is measure and the numeric value is 400

Actual Last Year is measure and numeric value is 200

So if user selected these two values in slicer, then It should call two measures and calculate the difference between Actual This Year - Actual Last Year.

if selected values are as Actual This Year and Forecasted V1 then calculate as difference between Actual This Year and Forecasted V1. and so on..

 

Kindly note, I have done this by applying all combinations between all 4 parameters and worked well. But in that case the calculation is feasible for only 3-4 KPIs comparision. if Number of kpis are more, then it wouldn't be a good solution to create n-1! ( factorial n-1 combinations of comparision).

 

Thanks in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sonuojha1 , Not very clear try like

 

Measure =
var _min = minx(allselcted('Table'),'Table'[selections])
var _max = maxx(allselcted('Table'),'Table'[selections])
return
Switch( True(),
_max = "ActualThisYear" ,[ActualThisYear],
_max = "ActualLastYear" ,[ActualThisYear]
// Add Other
) - Switch( True(),
_min = "ActualThisYear" ,[ActualThisYear],
_min = "ActualLastYear" ,[ActualThisYear]
// Add Other
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sonuojha1 , Not very clear try like

 

Measure =
var _min = minx(allselcted('Table'),'Table'[selections])
var _max = maxx(allselcted('Table'),'Table'[selections])
return
Switch( True(),
_max = "ActualThisYear" ,[ActualThisYear],
_max = "ActualLastYear" ,[ActualThisYear]
// Add Other
) - Switch( True(),
_min = "ActualThisYear" ,[ActualThisYear],
_min = "ActualLastYear" ,[ActualThisYear]
// Add Other
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Thanks Amit,

 

It worked. 

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.

Top Solution Authors