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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
v-yangliu-msft
Community Support
Community Support

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
v-yangliu-msft
Community Support
Community Support

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors