Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have created a measure to tell me whether a task is overdue based on it's due date. This is the DAX I used:
Solved! Go to Solution.
@GeekyT , Not very clear, Create a color measure and use that in conditional formatting with "Field value"
State = Switch( true(),
MIN('wkaw'[Due Date])<TODAY(),"green",
MIN('wkaw'[Due Date])>=TODAY(),"yellow",
MIN('wkaw'[Due Date])>=TODAY()+7,"red"
)
refer https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Hi @GeekyT ,
The condittional formatting based on field value means that you have to set the colour that you need on your measure in this case yuou need to redo your measure to one of the formulas below.
One thing that I believe is also best is instead of havinf nested IF is to use SWITCH function.
State =
SWITCH (
TRUE (),
MIN ( 'wkaw'[Due Date] ) < TODAY (), "Red",
MIN ( 'wkaw'[Due Date] ) >= TODAY (), "Green",
MIN ( 'wkaw'[Due Date] )
>= TODAY () + 7, "Blue"
)
State =
SWITCH (
TRUE (),
MIN ( 'wkaw'[Due Date] ) < TODAY (), "#00000",
MIN ( 'wkaw'[Due Date] ) >= TODAY (), "#123456",
MIN ( 'wkaw'[Due Date] )
>= TODAY () + 7, "#963852"
)
The first measure you can write the colour you need directly, on the second one I'm using the HEX code so you can change the 6 digits in each one for the custom colours you want.
Then you canuse the based in value formula for the conditional formatting.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@GeekyT , Not very clear, Create a color measure and use that in conditional formatting with "Field value"
State = Switch( true(),
MIN('wkaw'[Due Date])<TODAY(),"green",
MIN('wkaw'[Due Date])>=TODAY(),"yellow",
MIN('wkaw'[Due Date])>=TODAY()+7,"red"
)
refer https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |