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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors