Forum Discussion
Conditional Formatting
- 1 year ago
Hi, please follow these steps:
For table1 to see only future months, please create the following measure:IsFutureMonth = IF( LASTDATE('Date'[Date]) > EOMONTH(TODAY(),0), 1, 0 )For table2, to see only future and present month, please create the following measure:
IsFutureMonthPresent = IF( LASTDATE('Date'[Date]) >= EOMONTH(TODAY(),0), 1, 0 )Now lets format your visual.
Select your table1, and in the Values field, right click on desired measure and add a conditional formatting as shown bellow:
In the prompt, in format style, choose Rules based on isFutureMonth measure, and color red when the value is 1, make sure to choose number and not percent, as shown bellow:
Repeat this steps for other values that you want to format in your matrix, and for you table2, just format using the measure isFuturePresent.
Your final result should look like this:
Download the sample: Case Modelling - Copy
Hi, thanks for your reply.
Unfortunately its still not working.
My data model is a simple one:
The Month column in my date table is Text =
Month = FORMAT('Date'[Date], "MMM")
and so I get this error message with your measure:
When I modify your measure to this then the formatting stays all black for the Original Forecast column:
Red or Black =
IF (
MONTH ( MAX ( 'Date'[Date] ) ) >= MONTH ( TODAY () )
|| YEAR ( MAX ( 'Date'[Date] ) ) > YEAR ( TODAY () ),
"red",
"black"
)
Hi, ArchStanton
Thank you for your response.
As you suspected, we believe this issue might be caused by table relationships. We would appreciate it if you could provide your PBIX file so that we can tailor the solution based on your specific details.
We recommend uploading it to GitHub and sharing the link with us.When uploading a file, please be careful to delete sensitive information.
Looking forward to your reply.
Best Regards,
Leroy Lu
- ArchStanton1 year ago
Power Participant