Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors