Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
81 | |
48 | |
37 | |
27 |
User | Count |
---|---|
185 | |
73 | |
73 | |
50 | |
42 |