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.
Hi Experts
Need a DAX measure as a calculated column to work out the following rule inorder to colour a bar chart visual, here is the rule
1. Todays Date is 10.11.21 < then todays date "red",
2. Next month ie Dec 21 "Amber", When we are in Dec 21 Then Jan 22 is Amber only and so on
3. Any date in the future excluding next month ie Dec 21 (which would be Amber as per point 2) "Green"
https://www.dropbox.com/s/bwxvb5wilqrqlge/Sample_File.pbix?dl=0
the measure i have and is not working is
a measure =
Switch(true() ,
max('Date'[Date]) < Today() , "Red",
max('Date'[Date]) < eomonth(Today(),1) , "Amber",,
"Green"
)
Solved! Go to Solution.
With conditional formatting for tables in Power BI Desktop, you can specify customized cell colors, including color gradients, based on field values. You can also represent cell values with data bars or KPI icons, or as active web links. You can apply conditional formatting to any text or data field, if you base the formatting on a field that has numeric, color name or hex code, or web URL values.
Suggested Article: Easy Steps To Generate Interactive Power BI Reports
Hi @dynamicssquare ,
Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thanks in advance!
Hope it helps,
Community Support Team _ Caitlyn
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , what happen remaining nov ?
a measure like
a measure =
Switch(true() ,
max('Date'[Date]) < Today() , "Red",
max('Date'[Date]) >= eomonth(Today(),0) +1 && max('Date'[Date]) <= eomonth(Today(),1) , "Amber",
"Green"
)
a measure =
Switch(true() ,
max('Date'[Date]) < Today() , "Red",
max('Date'[Date]) < eomonth(Today(),0) , "Green" // remaining nov color , change that
max('Date'[Date]) >= eomonth(Today(),0) +1 && max('Date'[Date]) <= eomonth(Today(),1) , "Amber", //dec , next month
"Green"
)
With conditional formatting for tables in Power BI Desktop, you can specify customized cell colors, including color gradients, based on field values. You can also represent cell values with data bars or KPI icons, or as active web links. You can apply conditional formatting to any text or data field, if you base the formatting on a field that has numeric, color name or hex code, or web URL values.
Suggested Article: Easy Steps To Generate Interactive Power BI Reports
If its nov then assume in the past.....even thow we are still in Nov and the month has not completed...
@Anonymous , try like
a measure =
Switch(true() ,
max('Date'[Date]) <= eomonth(Today(),0) , "Red" // less than nov
max('Date'[Date]) >= eomonth(Today(),0) +1 && max('Date'[Date]) <= eomonth(Today(),1) , "Amber", //dec , next month
"Green"
)
i Think the error is that the above is a measure and i need a calculted column
Hi Amit - Sorry to be a pain but can you implement it to the PBIX file i attached cannot get it to work...
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 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |