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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors