Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I am having some issues with conditional formatting and maybe the more experienced users here can give me a hint in the right direction.
Data
A list of dates, categorized by project and department. Every date also has a status, in the example here "Finished" and "Planned".
Visual
A table that displays the latest date for each project and department. The dates should be colored according to their status, i.e. Finished is green and Planned is orange. In the real data there are more options for status.
I tried simply solving it with some columns that list the color and then assigning the field color based on that field. But this doesn't work, because I need to choose a summarization for the field values, either First or Last, which just sorts the color names alphabetically insted of using the the one next to the field. (I changed Orange to Gold because it accidently displayed the correct result.)
Is there a way to get a measure that returns the correct color?
Edit: Added link to example data
Solved! Go to Solution.
@Anonymous , You have to create color measures like this one and use them in conditional formatting with "Field value" option
measure =
var _max = calculate(max(Table[status]), filter(Table, table[project] = max(Table[project]) && table[Department] = max(Table[Department]) && Table[Date1] =[latest date 1]))
return
if(_max= "Finished", "green", "red")
refer for steps
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
@Anonymous , You have to create color measures like this one and use them in conditional formatting with "Field value" option
measure =
var _max = calculate(max(Table[status]), filter(Table, table[project] = max(Table[project]) && table[Department] = max(Table[Department]) && Table[Date1] =[latest date 1]))
return
if(_max= "Finished", "green", "red")
refer for steps
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Hi @amitchandak,
your solution works flawlessly. After retracing the formula step by step, I think that I now understand the capabilities of DAX measures much more, so thanks a lot for that!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
75 | |
64 | |
52 | |
47 |
User | Count |
---|---|
218 | |
87 | |
71 | |
63 | |
60 |