Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sid-poly
Helper I
Helper I

DAX Measure and Background Colour Not Working

I have written a DAX and upon that I want to do color Coding based on certain conditions, 

DAX Code 

Reporting months = var MAXD=MAX('Dim_Date'[MMDDYYYY])
var Last13M = DATESINPERIOD('ABCD'[DateOfSample],MAXD,-12,MONTH)
RETURN
Calculate(Sum('ABCD'[Value]),REMOVEFILTERS('Dim_Date'),KEEPFILTERS(Last13M),USERELATIONSHIP('Dim_Date'[MMDDYYYY],'ABCD'[DateOfSample]))
 
I Have three columns now, Value, EFG, ZPR

Based on the condition on the above three columns, I need to give a background color. It could be like

DAX M = SWITCH(TRUE(),
Value > 1, "Some color"

Value = -1 , "Some color"
 
Value > EFG, " Some Color",

Value < ZPR, "Some Color"

"Some color")

But when I do it in the conditional formatting, it doesn't work and highlights only the selected month-year combination and nothing apart from it. You can also see we are using Value column in the measure. 

Any heads up?
1 REPLY 1
Fowmy
Super User
Super User

@sid-poly 

Sharing a dummy Power BI file representing your scenario would be beneficial. You can save the Power BI file on Google Drive or any other cloud storage platform and provide the link here. Kindly ensure that permission is granted to open the file.


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.