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
KatPrf
New Member

Creating a greater than, equal to or less than text slicer

Hi all! 
have a table in Power BI (called RatingOrder) which has the following columns:  category, rating and order for each rating. Here is some sample data in the table:

category | Rating | Order

Blue | A++ | 3

Blue | A- | 2

Blue | B | 1

Red | A | 4

Red | B+ | 3

Red | B- | 2

Red | C | 1

 

I want the users to be able to select a category (from a slicer) then choose ‘greater than’ or ‘equal to’ or ‘less than’ (which are determined by the order field) using another slicer, and then select a rating and get the results based on their selections. For example if they select category = blue and greater than B, the results they should get are A++ and A-. Or if the select category = Red and less than B+ the output should be B- and C.

Could you please let me know how to achieve the above? I know how to create simple slicers like the category slicer that I mentioned above but not sure how to create the greater than, less than and equal to. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

for creating the logical operator functionality I would recommend creating a table with those 3 values as rows, and then you can create measures  that operate on the logical slicer.

here is an example measure:

Result Measure = 
VAR SelectedCategory = SELECTEDVALUE('RatingOrder'[category])
VAR SelectedOperation = SELECTEDVALUE('ComparisonOperationTable'[Operation])
VAR SelectedRatingOrder = SELECTEDVALUE('RatingOrder'[Order])

RETURN
    CALCULATE(
        COUNTROWS('RatingOrder'),
        'RatingOrder'[category] = SelectedCategory,
        SWITCH(
            SelectedOperation,
            "greater than", 'RatingOrder'[Order] > SelectedRatingOrder,
            "less than", 'RatingOrder'[Order] < SelectedRatingOrder,
            'RatingOrder'[Order] = SelectedRatingOrder
        )
    )



View solution in original post

1 REPLY 1
Anonymous
Not applicable

for creating the logical operator functionality I would recommend creating a table with those 3 values as rows, and then you can create measures  that operate on the logical slicer.

here is an example measure:

Result Measure = 
VAR SelectedCategory = SELECTEDVALUE('RatingOrder'[category])
VAR SelectedOperation = SELECTEDVALUE('ComparisonOperationTable'[Operation])
VAR SelectedRatingOrder = SELECTEDVALUE('RatingOrder'[Order])

RETURN
    CALCULATE(
        COUNTROWS('RatingOrder'),
        'RatingOrder'[category] = SelectedCategory,
        SWITCH(
            SelectedOperation,
            "greater than", 'RatingOrder'[Order] > SelectedRatingOrder,
            "less than", 'RatingOrder'[Order] < SelectedRatingOrder,
            'RatingOrder'[Order] = SelectedRatingOrder
        )
    )



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.