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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Conditionnal formatting of last refresh date

Hello everyone,

 

I have my last refresh date that show up in a card visual. I would like to conditional format it so it show in red if it is older than 2 hours.

Do you guys know how to do that ? I searched for a bit but it seems nobody ever needed this, or it is so simple nobody ever asked.

 

Thanks in advance,

James

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Here are the steps you can follow:

1. Get "Last Refreshed Date" via the following link”.

How to Show Last Refresh Date in Power BI / Blogs / Perficient

vyangliumsft_0-1676879427431.png

2. Create measure.

Now = NOW()
Last Refreshed Date =
MAX('Last Refreshed Date'[Column1])
Color =
var _datediffminute=
DATEDIFF(
    [Last Refreshed Date],[Now],MINUTE)
var _2hour=
60 * 2
return
IF(
    _datediffminute>_2hour,"red","green")

3. Visualizations – Callout value – FX.

vyangliumsft_1-1676879427432.png

 

vyangliumsft_2-1676879427433.png

4. Result:

vyangliumsft_3-1676879427434.png

 

Best Regards,

Liu Yang

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Here are the steps you can follow:

1. Get "Last Refreshed Date" via the following link”.

How to Show Last Refresh Date in Power BI / Blogs / Perficient

vyangliumsft_0-1676879427431.png

2. Create measure.

Now = NOW()
Last Refreshed Date =
MAX('Last Refreshed Date'[Column1])
Color =
var _datediffminute=
DATEDIFF(
    [Last Refreshed Date],[Now],MINUTE)
var _2hour=
60 * 2
return
IF(
    _datediffminute>_2hour,"red","green")

3. Visualizations – Callout value – FX.

vyangliumsft_1-1676879427432.png

 

vyangliumsft_2-1676879427433.png

4. Result:

vyangliumsft_3-1676879427434.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

AilleryO
Memorable Member
Memorable Member

Hi,

 

My first idea, would be to create a Mesure to calculate the difference between now and that date-time refresh, and to check if it more than 2 hours.

Example :

MesureTest =

VAR DateToday=
    TODAY ()
RETURN
    IF ( LASTDATE ( TableDate[Date] ) < DateToday, 1, 0 )

Then you cas use this Mesure for conditionnal formatting.

Using Rules and if your test mesure = 0 (or 1) then choose color.

 

Let us know if it works 

Anonymous
Not applicable

That's what I considered first too. But I can't use my Last refresh table in a dax formula. I can't figure why.

James_C_0-1676619290666.png

James_C_1-1676619301567.png

 

It is actualized by a query that marks it =NOW() so it updates everytime the dataset is refreshed.

Any idea why, or how I could sove this ?

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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