Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello all,
How can I create a column that shows me how many days have passed between diffrent dates?
Dates | Day Between |
Monday, 3. Aug 2020 | |
Friday, 31. Jul 2020 | 3 |
Thursday, 30. Jul 2020 | 1 |
Monday, 20. Jul 2020 | 10 |
Tuesday, 14. Jul 2020 | 6 |
Thank you in advance for your time.
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)
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)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
ColumnB = VAR _theDate = TableD[Dates]
VAR _1higherDate = MINX(FILTER(TableD, TableD[Dates] > _theDate), TableD[Dates] )
RETURN
DATEDIFF( _theDate, _1higherDate, DAY)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
15 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |