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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
PaulBethancourt
Frequent Visitor

Display the Number of Days Between Report Dates

I'm trying to find the number of days between 2 dates (the Report_Date and the prior Report_Date).

This seems simple but it's eluding me.

PaulBethancourt_0-1670260903988.png

 

1 ACCEPTED SOLUTION

This worked for me

Days =
Var PreviousDate =
calculate(max('SCM_RMA_METRICS'[Report Date Full]),filter(all(SCM_RMA_METRICS),SCM_RMA_METRICS[Report Date Full]<earlier(SCM_RMA_METRICS[Report Date Full])))
return
If(PreviousDate<>0,SCM_RMA_METRICS[Report Date Full]-PreviousDate,0)

View solution in original post

4 REPLIES 4
PaulBethancourt
Frequent Visitor

Thanks Bifinity_75.  It is throwing up an error:

PaulBethancourt_1-1670338165111.png

 

Bifinity_75
Solution Sage
Solution Sage

Hi @PaulBethancourt, try this calculate column:

Days = 
var PreviousDate = 
MAXX(FILTER(ALL('Table'),EARLIER('Table'[REPORT_DATE]) > 'Table'[REPORT_DATE]),'Table'[REPORT_DATE])
Return
if (PreviousDate<>0,'Table'[REPORT_DATE]-PreviousDate,0)

The result:

Bifinity_75_1-1670264716793.png

 

Best Regards

 

 

This worked for me

Days =
Var PreviousDate =
calculate(max('SCM_RMA_METRICS'[Report Date Full]),filter(all(SCM_RMA_METRICS),SCM_RMA_METRICS[Report Date Full]<earlier(SCM_RMA_METRICS[Report Date Full])))
return
If(PreviousDate<>0,SCM_RMA_METRICS[Report Date Full]-PreviousDate,0)

Days =
var PreviousDate =
MAXX(FILTER(ALL(SCM_RMA_METRICS),EARLIER(SCM_RMA_METRICS[REPORT_DATE]) > SCM_RMA_METRICS[REPORT_DATE]),SCM_RMA_METRICS[REPORT_DATE])
Return
if (PreviousDate<>0,SCM_RMA_METRICS[REPORT_DATE]-PreviousDate,0)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors