The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a report that uses the same structure as the example below. I am using a disconnected table and a SWITCH measure to create headers and display values in the Matrix visual.
I've been asked to add conditional formatting to the "Revenue Actual" and "Return on Investment Actual" columns with the following criteria.
Revenue Actual: <=$999,999 is Red, = $10,000,000 is Black, >=$10,000,001 is Green
Return on Investment Actual: <=%699 is Red, = %700 is Black, >= %701 is Green
I'm not sure where to get started with conditional formatting since all my measures are "built into" the single SWITCH measure.
Can anyone provide guidance on how I can accomplish this?
Solved! Go to Solution.
Hi @ERing - Great! You're using a disconnected table with a SWITCH measure to dynamically display different KPIs in a Matrix visual — this is a smart, flexible setup.
Header Format Color =
VAR SelectedMeasure = SELECTEDVALUE(MHeaders[Measure Name])
VAR RevenueValue = [Revenue_Actual]
VAR ROIValue = [ROI Actual]
RETURN
SWITCH (
TRUE(),
SelectedMeasure = "Revenue Actual" && RevenueValue <= 999999, "Red",
SelectedMeasure = "Revenue Actual" && RevenueValue = 10000000, "Black",
SelectedMeasure = "Revenue Actual" && RevenueValue >= 10000001, "Green",
SelectedMeasure = "ROI Actual" && ROIValue <= 699, "Red",
SelectedMeasure = "ROI Actual" && ROIValue = 700, "Black",
SelectedMeasure = "ROI Actual" && ROIValue >= 701, "Green",
BLANK()
)
Select your Matrix visual.
Click the dropdown on the "Values" field (which is your Header Measures 01).
Choose Conditional formatting > Font color (or Background color, depending on your preference).
In the dialog, switch to "Field value" instead of using rules.
Choose the new measure Header Format Color as the formatting field.
Apply.
Proud to be a Super User! | |
Hi @ERing - Great! You're using a disconnected table with a SWITCH measure to dynamically display different KPIs in a Matrix visual — this is a smart, flexible setup.
Header Format Color =
VAR SelectedMeasure = SELECTEDVALUE(MHeaders[Measure Name])
VAR RevenueValue = [Revenue_Actual]
VAR ROIValue = [ROI Actual]
RETURN
SWITCH (
TRUE(),
SelectedMeasure = "Revenue Actual" && RevenueValue <= 999999, "Red",
SelectedMeasure = "Revenue Actual" && RevenueValue = 10000000, "Black",
SelectedMeasure = "Revenue Actual" && RevenueValue >= 10000001, "Green",
SelectedMeasure = "ROI Actual" && ROIValue <= 699, "Red",
SelectedMeasure = "ROI Actual" && ROIValue = 700, "Black",
SelectedMeasure = "ROI Actual" && ROIValue >= 701, "Green",
BLANK()
)
Select your Matrix visual.
Click the dropdown on the "Values" field (which is your Header Measures 01).
Choose Conditional formatting > Font color (or Background color, depending on your preference).
In the dialog, switch to "Field value" instead of using rules.
Choose the new measure Header Format Color as the formatting field.
Apply.
Proud to be a Super User! | |
User | Count |
---|---|
69 | |
67 | |
62 | |
48 | |
28 |
User | Count |
---|---|
112 | |
81 | |
66 | |
54 | |
43 |