Forum Discussion

paw1's avatar
paw1
Helper I
3 years ago
Solved

conditional formatting

Hi,

Can any one please help me to apply conditional formating on below table. I have a data source like below.

I need to highlite the deals with yellow background color which comes under today date to first date of previous month i.e., Deal A comes under this category. Please help me to highlite deal a with yellow bg.

 

 

DealClosed DateToday Date
a1-Jan-237-Feb-23
b10-Jan-237-Feb-23
c1-Feb-237-Feb-23
d1-Jan-227-Feb-23
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi paw1 ,

    Please try below steps;

    1. below is my test table

    Table:

    2. create measure with below dax formula

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'Table'[Today Date] )
    VAR _b =
        SELECTEDVALUE ( 'Table'[Closed Date] )
    VAR _day =
        DAY ( _b )
    RETURN
        IF ( AND ( DATEDIFF ( _b, _a, MONTH ) = 1, _day = 1 ), "yellow" )
    

    3. set conditional format background color for fields

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi paw1 ,

    Please try below steps;

    1. below is my test table

    Table:

    2. create measure with below dax formula

    Measure =
    VAR _a =
        SELECTEDVALUE ( 'Table'[Today Date] )
    VAR _b =
        SELECTEDVALUE ( 'Table'[Closed Date] )
    VAR _day =
        DAY ( _b )
    RETURN
        IF ( AND ( DATEDIFF ( _b, _a, MONTH ) = 1, _day = 1 ), "yellow" )
    

    3. set conditional format background color for fields

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.