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'm struggling to figure out how to create a measure to conditionally format a matrix. Here's a picture of my matrix:
I"d like to color code all 3 columns under the post group, so that if the value is greater than the corresponding value in the 'Pre' group, then color code green, otherwise color code red
I have my data in a long format rather than wide, so I'm not sure how to go about creating the DAX measure to do this. Here's a sample of it:
Solved! Go to Solution.
Hi @kimchizal,
Please download the demo from the attachment. Please also refer to power-bi/desktop-conditional-table-formatting.
formatMeasure = VAR postValue = CALCULATE ( [Program(s)], FILTER ( ALL ( Sheet3[prepost] ), Sheet3[prepost] = "Post" ) ) VAR preValue = CALCULATE ( [Program(s)], FILTER ( ALL ( Sheet3[prepost] ), Sheet3[prepost] = "Pre" ) ) RETURN IF ( postValue > preValue, 1, 0 )
BTW, please don't share sensitive data here.
Best Regards,
Hi @kimchizal,
Could you please mark the proper answers as solutions?
Best Regards,
Here's a link to the data: removed
Hi @kimchizal,
Please download the demo from the attachment. Please also refer to power-bi/desktop-conditional-table-formatting.
formatMeasure = VAR postValue = CALCULATE ( [Program(s)], FILTER ( ALL ( Sheet3[prepost] ), Sheet3[prepost] = "Post" ) ) VAR preValue = CALCULATE ( [Program(s)], FILTER ( ALL ( Sheet3[prepost] ), Sheet3[prepost] = "Pre" ) ) RETURN IF ( postValue > preValue, 1, 0 )
BTW, please don't share sensitive data here.
Best Regards,
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
71 | |
67 | |
51 | |
39 | |
26 |
User | Count |
---|---|
87 | |
54 | |
45 | |
40 | |
36 |