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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I have created a traffic light measure with multiple condition which are already based on other measure calculations.
The idea is to use the measure as Slicer I have read there is a workaround to create table out of the measure output, but I am sure this could work with multiple conditions.
My measure looks like this :
Solved! Go to Solution.
Here are a few examples
Solved: Measure as Slicer - Workaround? - Microsoft Power BI Community
Solved: How to use a measure as slicer? - Microsoft Power BI Community
Regards,
Ritesh
Hi @ybyb23 ,
Here is my test table:
Table:
Slicer:
1.create a slicer visual with slicervalue
2.create a dax formula and add it to table visual
Traffic =
VAR _slicerval =
SELECTEDVALUE ( Slicer[SlicerValue] )
RETURN
SWITCH (
TRUE,
MAX ( 'Table'[A] ) + MAX ( 'Table'[B] )
+ MAX ( 'Table'[C] )
= BLANK ()
&& _slicerval = 0, "Non Matching Pair",
MAX ( 'Table'[C] ) < 0
&& MAX ( 'Table'[A] ) > 0
&& MAX ( 'Table'[B] ) < 0
&& _slicerval = 1, "Price decrease while A increased",
MAX ( 'Table'[B] ) < 0
&& MAX ( 'Table'[B] ) < MAX ( 'Table'[A] )
&& _slicerval = 2, "Price decrease > A decrease",
MAX ( 'Table'[B] ) < 0
&& MAX ( 'Table'[B] ) > MAX ( 'Table'[A] )
&& _slicerval = 3, "Price increase < A increase",
MAX ( 'Table'[C] ) > 0
&& MAX ( 'Table'[A] ) < 0
&& MAX ( 'Table'[B] ) > 0
&& _slicerval = 4, "Price increase while A decreased",
MAX ( 'Table'[B] ) < 0
&& MAX ( 'Table'[A] ) < 0
&& _slicerval = 5, "Price decrease < A decrease",
MAX ( 'Table'[B] ) > 0
&& MAX ( 'Table'[A] ) > 0
&& _slicerval = 6, "Price increase > A increase"
)
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Thanks for your answer. Still through these examples I am facing some errors to get the slicer based on the measure that I have created. Basically thsis how my table looks like
| Dim1 | dim2 | dim3 | A | B | C | Traffic |
| Bread | flour | 14587 | 0.69% | -100% | -100% | Price decrease < A decrease |
| Bread | flour | 14759 | -8,32% | -100 | -100 | Price decrease < A decrease |
| Bread | flour | 45697 | Non Matching pair | |||
| Bread | flour | 13545 | Non matchin pair | |||
| Bread | flour | 54987 | non matching pair | |||
| Bread | flour | 24687 | non mtaching pair |
based on what I have understood that's what I have to do:
First : Create a table, I did in my case it will be
Traficlight_Name SlicerValue
Non Matching Pairr 0
Price decrease while A increase 1
Price decrease > A decrease 2
Price increase < A increase 3
Price increase while A decreased 4
Price decrease < A decrease 5
Price increase > A increase 6
I am missing the second step which I don't really understand if I have to write down again the conditions in my previous measure or what really has to be done in this step ?
Here are a few examples
Solved: Measure as Slicer - Workaround? - Microsoft Power BI Community
Solved: How to use a measure as slicer? - Microsoft Power BI Community
Regards,
Ritesh
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |