Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I try to conditional format different sets of data simultaneously through a bar chart that navigates through different KPIs through a slicer, I want the column to be colored green if the value is greater than or equal to the target value for example, I have listed the conditions below:
I have tried making a nested IF function and placed into a measure and then corresponding the output of the measure to the conditional formatting in the visual formatting as attached in the pics below but there's some kind of conflict that occurs that makes all the colors interfere with each other. The code i used is also pasted below:
I also tried to modify the code to this but also no use:
Solved! Go to Solution.
Hi @AhmedMedhat
I've written this so you can make them all seperate tests if you want to using the individual switches.
Color Change MC Eff. =
VAR currMeasure =
SELECTEDVALUE ( 'KPI'[KPI] )
RETURN
SWITCH (
currMeasure,
"MC Efficiency (%)", SWITCH ( TRUE (), [MC Efficiency (%)] > [MC Efficiency T], "Green" ,"Red"),
"Weigher Efficiency (%)", SWITCH ( TRUE (), [Weigher Efficiency (%)] > [Weigher Efficiency T], "Green","Red" ),
"GGA", SWITCH ( TRUE (), [GGA (gm)] < [GGA T], "Green","Red" ),
"Film Waste (%)", SWITCH ( TRUE (), [Film Waste (%)] < 'Film Waste (%)'[Film Waste T], "Green","Red" ),
"R&M", "orange",
"Operating Supplies", "orange",
"Red" --If anything else
)
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
@SamWiseOwl It turned out to be rounding figures as u mentioned, thanks a lot for the support
thanks Sam for your reply, however I pasted the code u provided and still there's some deviation from what's intended.
The GGA are all colored red and I modified the ">" to ">=" and still the values equal to the target are colored red (should be green)
I attached the file for u to review on google drive:
https://drive.google.com/drive/folders/13HYEo7dusjcHUzv7tT8pq5YXHcWR2d9G?usp=sharing
Hi @AhmedMedhat
The GGM needs to be GGM (gm) to match what it is in the slicer:
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
that's great!! but still the greater than or equal has problems
it should be colored green as the target is 99.5% as well
Hmm my guess is somewhere the rounding is being a bit odd.
Make sure they are set to the same.
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @AhmedMedhat
I've written this so you can make them all seperate tests if you want to using the individual switches.
Color Change MC Eff. =
VAR currMeasure =
SELECTEDVALUE ( 'KPI'[KPI] )
RETURN
SWITCH (
currMeasure,
"MC Efficiency (%)", SWITCH ( TRUE (), [MC Efficiency (%)] > [MC Efficiency T], "Green" ,"Red"),
"Weigher Efficiency (%)", SWITCH ( TRUE (), [Weigher Efficiency (%)] > [Weigher Efficiency T], "Green","Red" ),
"GGA", SWITCH ( TRUE (), [GGA (gm)] < [GGA T], "Green","Red" ),
"Film Waste (%)", SWITCH ( TRUE (), [Film Waste (%)] < 'Film Waste (%)'[Film Waste T], "Green","Red" ),
"R&M", "orange",
"Operating Supplies", "orange",
"Red" --If anything else
)
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
User | Count |
---|---|
70 | |
70 | |
34 | |
23 | |
22 |
User | Count |
---|---|
96 | |
94 | |
50 | |
42 | |
40 |