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
Anonymous
Not applicable

How can you create a column that shows the days between Dates?

Hello all,

 

How can I create a column that shows me how many days have passed between diffrent dates?

DatesDay Between
Monday, 3. Aug 2020 
Friday, 31. Jul 20203
Thursday, 30. Jul 20201
Monday, 20. Jul 202010
Tuesday, 14. Jul 20206

 

Thank you in advance for your time.

3 REPLIES 3
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Incase you want a measure

 

Dates B = 
var a = MAX(Table1[Date])
var _prevdate = CALCULATE(MAX(Table1[Date]) , FILTER(ALL(Table1),Table1[Date] < a))
RETURN
DATEDIFF(_prevdate,a,DAY)

 

1.jpg

 

Incase you want a Column

 

Prev Date = 
var _prevdate = CALCULATE(MAX(Table1[Date]) , FILTER(Table1,Table1[Date] < EARLIER(Table1[Date])))
RETURN
DATEDIFF(_prevdate,Table1[Date],DAY)

 

 

 

 

2.JPG

 

 

Regards,
Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

 

amitchandak
Super User
Super User

@Anonymous , try a new column like

datediff([dates], minx(filter(table, [dates]>earlier[dates]),[dates]),day)

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
HotChilli
Super User
Super User

ColumnB = VAR _theDate = TableD[Dates]
VAR _1higherDate = MINX(FILTER(TableD, TableD[Dates] > _theDate), TableD[Dates] )
RETURN
   DATEDIFF( _theDate, _1higherDate,  DAY)

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.