Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi I have struggled for few days now reading posts and trying all variations on how to build a conditional DAX and no matter which way i do it, it doesn't give me the result that I'm after.....
My original DAX is calculating diff sections as per below and what I'm after is one DAX that can change the colours accordingly, posted below too
Solved! Go to Solution.
Hi @michaelag ,
try this.
Selected_Actual_Vaues_Performance%_Colour =
VAR CurrentItem =
SELECTEDVALUE ( 'Performance % Template'[Perforamnce %] )
RETURN
SWITCH (
TRUE (),
CurrentItem = "Revenue %", IF ( [All_Income_VarPerc] <= 0.00, "Red", "Green" ),
CurrentItem = "Parts Mix %", IF ( [Parts_RatioPerc_Var] >= 0.00, "Red", "Green" ),
CurrentItem = "Panel GP %", IF ( [Panel_GP_Perc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Parts GP %", IF ( [Parts_GPPerc Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Paint GP %", IF ( [Paint_GPPerc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Sublet GP %", IF ( [Sublet_GPPerc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Liquid %", IF ( [Paint Liquid Perc Var to Budget] <= 0.00, "Green", "Red" ),
CurrentItem = "Consumables %", IF ( [Paint_Panel_ConsumablesPerc_Var] >= 0.00, "Red", "Green" ),
CurrentItem = "Overheads %", IF ( [OPS_ExpensesPerc_Var] <= 0.00, "Green", "Red" ),
CurrentItem = "Office Wages %", IF ( [Office Wages RatioPerc Var to Bud] <= 0.00, "Green", "Red" ),
CurrentItem = "Total GP %", IF ( [OPS_Total_GPPerc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "EBITDA %", IF ( [OPS_EBITDAPerc_Var] <= 0.00, "Red", "Green" )
)Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hi @michaelag ,
try this.
Selected_Actual_Vaues_Performance%_Colour =
VAR CurrentItem =
SELECTEDVALUE ( 'Performance % Template'[Perforamnce %] )
RETURN
SWITCH (
TRUE (),
CurrentItem = "Revenue %", IF ( [All_Income_VarPerc] <= 0.00, "Red", "Green" ),
CurrentItem = "Parts Mix %", IF ( [Parts_RatioPerc_Var] >= 0.00, "Red", "Green" ),
CurrentItem = "Panel GP %", IF ( [Panel_GP_Perc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Parts GP %", IF ( [Parts_GPPerc Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Paint GP %", IF ( [Paint_GPPerc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Sublet GP %", IF ( [Sublet_GPPerc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "Liquid %", IF ( [Paint Liquid Perc Var to Budget] <= 0.00, "Green", "Red" ),
CurrentItem = "Consumables %", IF ( [Paint_Panel_ConsumablesPerc_Var] >= 0.00, "Red", "Green" ),
CurrentItem = "Overheads %", IF ( [OPS_ExpensesPerc_Var] <= 0.00, "Green", "Red" ),
CurrentItem = "Office Wages %", IF ( [Office Wages RatioPerc Var to Bud] <= 0.00, "Green", "Red" ),
CurrentItem = "Total GP %", IF ( [OPS_Total_GPPerc_Var] <= 0.00, "Red", "Green" ),
CurrentItem = "EBITDA %", IF ( [OPS_EBITDAPerc_Var] <= 0.00, "Red", "Green" )
)Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Thank you 🙂 Worked a treat 🙂
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |