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 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
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 |
---|---|
97 | |
65 | |
45 | |
39 | |
31 |
User | Count |
---|---|
164 | |
111 | |
61 | |
53 | |
38 |