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! Request 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
Corey_M
Resolver II
Resolver II

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
Corey_M
Resolver II
Resolver II

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
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