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
Raman3456
Helper I
Helper I

Highlight Today and Yesterday Both based on measure

Hi guys,

 

Need to create measure based on the "Date" filed as today & yesterday then green color , other than "Red color 

 

Please suggest me if any idea

 

Regards,

Raman

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

I Split column LatestLastRefresh into 2 columns Date and Time.

https://drive.google.com/file/d/1kKVzzBYtQxVdyhfc6MZxLSlYY_DvsfLk/view?usp=sharing

 

Let me know if all good.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

17 REPLIES 17
aj1973
Community Champion
Community Champion

Hi @Raman3456 

Add a measure like this,

IF(OR(DATE[column] = today()), DATE[column] = today() - 1), "Green", "Red")

Then use the measure as conditional formating

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

HI Aj,

 

Thanks for the prompt reply ,

 

while using OR conditon in measure it is not showing the column name .

 

is there any other way .

 

Date is in Hierarchy.

 

Regards,

Raman

 

aj1973
Community Champion
Community Champion

here is an example

Color =
var _today = SELECTEDVALUE(Table[Date])
var _yesterday = _today - 1
return
IF(AND(_today = TODAY(), _yesterday), "Green", "Red")
 
Use AND instead of OR
 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I want to apply backgorund color to the date 

 

thanks for the reply 

aj1973
Community Champion
Community Champion

aj1973_0-1623244200950.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Raman3456_0-1623245643253.png

 

Every dates is coming green only 

 

if anydate not in yesterday or today it should be red.

 

Thanks .

HI Aj,

 

Color =
VAR _today=SELECTEDVALUE('EHPBIPrc And EHPBIAcute'[LastRefreshDate].[Date])
Var _Yesterday=TODAY()-1
return
if(OR(_today=TODAY(),_Yesterday),"Green","Red")
 
is this correct?
aj1973
Community Champion
Community Champion

Replace OR by AND

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Raman3456_0-1623247125884.png

 

My requirement is ( If date=today or yesterday then Green color rest all dates should be red color ).

 

but as on the screeshot everything will be getting red color only .

 

Thanks for the support AJ.

aj1973
Community Champion
Community Champion

Can you export that visual to Excel and send it to me please? I will take care of it

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I am unable to send my file with you .

 

 

aj1973
Community Champion
Community Champion

aj1973_0-1623250926363.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Access has been provided

aj1973
Community Champion
Community Champion

I Split column LatestLastRefresh into 2 columns Date and Time.

https://drive.google.com/file/d/1kKVzzBYtQxVdyhfc6MZxLSlYY_DvsfLk/view?usp=sharing

 

Let me know if all good.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Thank you so much Aj its working fine now.

 

Cheers

aj1973
Community Champion
Community Champion

Can't you share it on a cloud service like Onedrive, googledrive...

The URL?

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

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.