Forum Discussion

ArchStanton's avatar
ArchStanton
Power Participant
1 year ago
Solved

Conditional Formatting

Hi, Each month I am manually changing the font colour of the values below from red to black (red being future months). I would like to do this automatically when we start a new month - how can I do...
  • Bibiano_Geraldo's avatar
    Bibiano_Geraldo
    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