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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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.

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.

Top Solution Authors
Top Kudoed Authors