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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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