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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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