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

Create selectable categories for numeric slicer

I'm trying to create a slicer that will sort numeric data into one of three categories that can be selected by radio button or checkbox:

  • All
  • 20+
  • 50+

My data currently looks something like this:

 

Incident IDTotal Impact
ABC0
EFG12
HIJ145
KLM51
NOP26
ETC800

 

When I create a slicer based on the Impact column, it produces a slider, and since I have some high outliers, it's a ridiculously wide range, making the dragging function basically useless. I'm only interested in those three categories above. Is there a way to create them? Many thanks!

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

Hi @ReadTheIron ,

 

I agreed with @amitchandak 's suggestion—— You have to create an independent table using those three values. 

 

And I have entered a table as shown below:

need a table for slicer.PNG

 

Then please use the following formula to create a flag measure:

Flag =
VAR _sum =
    CALCULATE (
        SUM ( 'Table'[Total Impact] ),
        ALLEXCEPT ( 'Table', 'Table'[Incident ID] )
    )
RETURN
    SWITCH (
        MAX ( 'ForSlicer'[Catrgory] ),
        "20+", IF ( _sum > 20, 1 ),
        "50+", IF ( _sum > 50, 1 ),
        "All", 1
    )

Apply it to filter pane ,set as "is 1", the final output is shown below:

a flag measure for filter .gif

 

Best Regards,
Eyelyn Qin
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

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @ReadTheIron ,

 

I agreed with @amitchandak 's suggestion—— You have to create an independent table using those three values. 

 

And I have entered a table as shown below:

need a table for slicer.PNG

 

Then please use the following formula to create a flag measure:

Flag =
VAR _sum =
    CALCULATE (
        SUM ( 'Table'[Total Impact] ),
        ALLEXCEPT ( 'Table', 'Table'[Incident ID] )
    )
RETURN
    SWITCH (
        MAX ( 'ForSlicer'[Catrgory] ),
        "20+", IF ( _sum > 20, 1 ),
        "50+", IF ( _sum > 50, 1 ),
        "All", 1
    )

Apply it to filter pane ,set as "is 1", the final output is shown below:

a flag measure for filter .gif

 

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

ReadTheIron
Helper III
Helper III

Thanks for the response, @amitchandak ! I'm still quite new to Power BI so I'm having some trouble figuring out the last step. I've created the measure, then created a slicer with Buckets[Buckets] as the selected data field. It looks just like what I need!

ReadTheIron_0-1628686671614.png

 

However, when I make a selection, the graphics on the page don't change. They will change based on the slider based on the Impact field. Is there another connection I need to be making?

amitchandak
Super User
Super User

@ReadTheIron , You have to create an independent table using those three values. You can use enter data

 

Then based on selected value you can return the measure

 

Switch(selectedvales(Bucket[Bucket]) ,

"All", sum(Table[Total Impact]),

"20+",calculate( sum(Table[Total Impact]), filter(Table,Table[Total Impact] >=20)) ,

"50+",calculate( sum(Table[Total Impact]), filter(Table,Table[Total Impact] >=50))

)

 

Try a measure like above

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.