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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Paramjit
Helper II
Helper II

Measure in Slicer

Hi Team,

 

 

I have the below measure and need to use in the Slicer but unable to do. Could you pleaes help.

 

Range = CALCULATE(if([Rank 2]/MAXX(ALLSELECTED('Table'),[Rank 2])*100>67,"Long Jobs",
if([Rank 2]/MAXX(ALLSELECTED('Table'),[Rank 2])*100>33,"Mediam Jobs","Short Jobs")))

 

Rank 2= RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Average])),,ASC)

 

I am creating the Rank measure on Average column and then Range  measure (or precentile) as above.

Capture.JPG

 

@Anonymous 
@amitchandak 
@SivaMani 
@Icey 

@ryan_mayu 

@Greg_Deckler 

 

Thank you,

Paramjit

1 ACCEPTED SOLUTION
SivaMani
Resident Rockstar
Resident Rockstar

@Paramjit, Try the below approach and let me know if it meets your requirement,

 

  • Keep [Rank 2] Measure
  • Create a table

 SivaMani_0-1638521923963.png

 

  • Check the below logic and create a measure 

 

Range = 
VAR __Max = MAXX( ALL(<TableName>[ColumnName]),[Rank 2])
VAR __SelValue = SELECTEDVALUE('Table'[Name])
VAR __Perc = DIVIDE([Rank 2],__Max)

RETURN
SWITCH(
    TRUE(),
    __SelValue = "Long" && __Perc > .67,"Y",
    __SelValue = "Medium" && __Perc > .33, "Y",
    __SelValue="Short", "Y"
    )

 

  •  Add Range to Visual Level Filter and apply Range is 'Y'
  • Add Name(from step 2) to slicer
  • Test it

Hope it will help you!

 

 

Best Regards,
Siva Mani
Proud to be a Super User!
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

5 REPLIES 5
SivaMani
Resident Rockstar
Resident Rockstar

@Paramjit, Try the below approach and let me know if it meets your requirement,

 

  • Keep [Rank 2] Measure
  • Create a table

 SivaMani_0-1638521923963.png

 

  • Check the below logic and create a measure 

 

Range = 
VAR __Max = MAXX( ALL(<TableName>[ColumnName]),[Rank 2])
VAR __SelValue = SELECTEDVALUE('Table'[Name])
VAR __Perc = DIVIDE([Rank 2],__Max)

RETURN
SWITCH(
    TRUE(),
    __SelValue = "Long" && __Perc > .67,"Y",
    __SelValue = "Medium" && __Perc > .33, "Y",
    __SelValue="Short", "Y"
    )

 

  •  Add Range to Visual Level Filter and apply Range is 'Y'
  • Add Name(from step 2) to slicer
  • Test it

Hope it will help you!

 

 

Best Regards,
Siva Mani
Proud to be a Super User!
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

@SivaMani  Finally it worked and tested. Thank you so much.

@Paramjit, Glad to hear that🙂

amitchandak
Super User
Super User

@Paramjit , For slicer you have create an independent table with these value and then filter it in a measure 

 

assume table name RangeBucket

 

New measure = sumx(filter(Values(Table[Run ID]), [Range] = max(RangeBucket[Value]) ), CALCULATE(SUM('Table'[Average])) )

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

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 

 

i tried the same but it is duplicating the values. 

 

I am not able to filter out the null values.  Please suggest.

 

 

 

 

itchandak Capture 1.JPG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.