cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paw1
Helper I
Helper I

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
1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @paw1 ,

Please try below steps;

1. below is my test table

Table:

vbinbinyumsft_0-1675821947801.png

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

vbinbinyumsft_1-1675822061885.png

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.

View solution in original post

1 REPLY 1
v-binbinyu-msft
Community Support
Community Support

Hi @paw1 ,

Please try below steps;

1. below is my test table

Table:

vbinbinyumsft_0-1675821947801.png

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

vbinbinyumsft_1-1675822061885.png

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.

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors