Forum Discussion
JLambs20
3 years agoHelper III
Determining Gaps between Dates
Hello, I am trying to determine start and end dates of a range that act as a "gap" between when a room is occupied. So, a room would be occupied from a start to an end date. However, after the ...
Anonymous
3 years agoNot applicable
Hi JLambs20 ,
I have created a simple smaple, please refer to it to see if it helps you.
Add an index column in the Power Query.
Then add two custom columns.
=Date.AddDays([End], 1)=try Date.AddDays(Table.SelectRows(#"Added Custom",(x)=>x[Index]=[Index]+1)[start]{0},-1) otherwise ""
I have also create columns use dax.
gap end = var _next=CALCULATE(MAX('Table'[start]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])+1))
return
IF(_next=BLANK(),BLANK(),_next-1)gap start = 'Table'[End]+1
If I have misunderstood your meaning, please provide more details with your desired output and pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.