Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi all!
I 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.
Solved! Go to Solution.
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
)
)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
)
)Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 62 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 105 | |
| 45 | |
| 32 | |
| 24 |