Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Max selected value in a slicer

Hi,

 

I have 2 columns. Week Number and Value so my data look like this

    

Week   Value
54445
636
7335
86
944
101414

 

I have a slicer for Week number. What Im trying to do is take the maximum value selected on the slicer. So for example if the user selected the maximum value of the slicer to be 8 I want to take this value and subtract 2 out of it. and then create another measure to check if this number = the week number then return a yes else return a no.

 

The measures I created:

Week - 2 = MAX(Sheet1[week])-2
measure test = IF(Week - 2 = max(Sheet1[week]) , "Yes","No")
 
The desired output should be like this
 

 

Week   Value  measure test
54445no
636yes
7335no
86no
944no
101414no

 

But its returning a "no" for all fields. And I realized that its not taking the max value of the selected slicer - 2 and compare it with all records, rather its subtracting 2 from every record and then compare it with the original number of that record before subtracting a 2.

 

Your help is highly appriciated.

Thank you!

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

Hi @Anonymous ,

 

We can use the following steps to meet your requirement:

 

  1. Create a new table that contains unique week number.
 

32.png

 

  1. We can create a measure to calculate “Yes” or “No”

measure test =

var select_slicer = SELECTEDVALUE('Table 2'[Week])

var week_2 = select_slicer-2

return

IF(week_2 = max('Table'[Week]) , "Yes","No")

 

  1. At last use the Table2[Week] to be slicer, we can get the result like this,
 

33.png

 

BTW, pbix as attached.


Best regards,

 

Community Support Team _ Dong Li
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-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can use the following steps to meet your requirement:

 

  1. Create a new table that contains unique week number.
 

32.png

 

  1. We can create a measure to calculate “Yes” or “No”

measure test =

var select_slicer = SELECTEDVALUE('Table 2'[Week])

var week_2 = select_slicer-2

return

IF(week_2 = max('Table'[Week]) , "Yes","No")

 

  1. At last use the Table2[Week] to be slicer, we can get the result like this,
 

33.png

 

BTW, pbix as attached.


Best regards,

 

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors