Forum Discussion
MChakri
3 years agoRegular Visitor
Conditional Formatting - Switch Case
Hello Pals,
I have a peculiar case with Switch statement as I am unable to apply conditional formatting for a single line item. Lets say, I have 5 line items and calculated against months like JAN, FEB, ...DEC, Q1, Q2, Q3, Q4, YTD etc..,I have a Grand total as 5th line item and that line item need to have a conditional formatting for "-" values. (Identified with a different color instead of default).
We would like to see the conditional formatting for Total other Margin and Net Margin should be with different color in Power BI.
Switch statement looks like the above
10 Replies
- AkshaanFrequent Visitor
Hi MChakri, This is the answer to the above asked question:
CF =SWITCH(SELECTEDVALUE('New Table'[Report Column]),"Other: Audit Accruals/Credits Margin" , IF([JANNEWF]<0, "Red"))
Here are my observations/suggestions:
1. Use hierarchies instead of calculated column Categorn intern with some additional spaces2. You derived field i.e. JANNEWF , FEBNEWF should be in Whole Number format instead of text to make this code work.