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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Previous and next date from the calendar (metric)

Hi Everyone,

I have a table with different dates (screen) which shows when the source data for this table will be refreshed.

GOAL: using the TODAY () or other function to show on the card when the last data refresh was made and when the next will be (screen). Of course, with the change of the month, the metric should also go from P08 to P09 and so on (up to P12). Does anybody have any idea?

 

Screen with issue and expected resultScreen with issue and expected result

 

Thank you very much in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,  Unpivot the table first to get P08 , P09 in rows

https://radacad.com/pivot-and-unpivot-with-power-bi

Then have measure like

 

last refresh =

var _period = "P"& format(Today(), "MM")

return

maxx(filter(Table, [period] = _period  && [Date] <= Today()) , [Date])

 

 

Nextrefresh =

var _period = "P"& format(Today(), "MM")

return

Minx(filter(Table, [period] = _period  && [Date] > Today()), [Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak Thank you so much! It works! 🙂

amitchandak
Super User
Super User

@Anonymous ,  Unpivot the table first to get P08 , P09 in rows

https://radacad.com/pivot-and-unpivot-with-power-bi

Then have measure like

 

last refresh =

var _period = "P"& format(Today(), "MM")

return

maxx(filter(Table, [period] = _period  && [Date] <= Today()) , [Date])

 

 

Nextrefresh =

var _period = "P"& format(Today(), "MM")

return

Minx(filter(Table, [period] = _period  && [Date] > Today()), [Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.