Forum Discussion
Conditional Formatting for Dates
- 5 years ago
amitchandak I could not create a measure as you typed using the IF function, the measure could not reference a column in a table, however, I did use the function you typed to create a calculated column, instead of "Red" I used "1" and instead of "Yellow" I used "2". Prior to adding the table column I created a measure someone else suggested in a post, Anonymous , the measure is Today = TODAY(). Then the formula I used was this:
Past Due/Within 7 Days Submittal = IF('Table'[Original Submittal Date] < [Today] && 'Table'[Original Submittal Date Status]="F",1,IF('Table[Original Submittal Date] >= [Today] && 'Table[Original Submittal Date] <= [Today]+7 &&'Table[Original Submittal Date Status]="F",2,0))The last step is to select the conditional formatting for the Original Submittal Date, selected Format by Rules, based on field Past Due/Within 7 Days Submittal, and if the number was 1 I chose a red format, if the value was 2 I chose a yellow format. And that did it!Thank you both, amitchandak and Anonymous
Oana , Create a color measure like this and use that in conditional formatting using field value option
color =
IF( [Original Submittal Date] < TODAY() && [Original Submittal Status] = "F","Red", IF([Original Submittal Date]>= TODAY() && [Original Submittal Date] <= Today()+7 && [Original Submittal Status] = "F", "Yellow" ), "White")
How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4
- Oana5 years agoAdvocate I
amitchandak I could not create a measure as you typed using the IF function, the measure could not reference a column in a table, however, I did use the function you typed to create a calculated column, instead of "Red" I used "1" and instead of "Yellow" I used "2". Prior to adding the table column I created a measure someone else suggested in a post, Anonymous , the measure is Today = TODAY(). Then the formula I used was this:
Past Due/Within 7 Days Submittal = IF('Table'[Original Submittal Date] < [Today] && 'Table'[Original Submittal Date Status]="F",1,IF('Table[Original Submittal Date] >= [Today] && 'Table[Original Submittal Date] <= [Today]+7 &&'Table[Original Submittal Date Status]="F",2,0))The last step is to select the conditional formatting for the Original Submittal Date, selected Format by Rules, based on field Past Due/Within 7 Days Submittal, and if the number was 1 I chose a red format, if the value was 2 I chose a yellow format. And that did it!Thank you both, amitchandak and Anonymous