Grouping Dates by Object

I’m working on an object hire report that needs to group objects with consecutive borrowed on dates into a single row in a table visual. The columns are;

Object No
Borrowed Date
Returned Date

Using SWITCH to calculate the Start Date and End Date dynamically based on a date slicer. What I need to do now is combine those two into a single line when the borrowed date(s) are consecutive days.

In this screen shot, the last two lines need to be combined into a single row with the start date being 18/01/2021 and the end date being 19/01/2021. The dates in the slicer are 01/01/2021 to 30/01/2021 which is why the first lines start and end dates are blank.

I’ve uploaded a cleaned copy of the report.

1 Like

GROUP BY QUERY.pbix (224.9 KB) Object Issuance.xlsx (67.9 KB)

This screen shot is what it being returned.
image

This is what I am trying to achieve
image

Check this it may help you : https://community.powerbi.com/t5/Community-Blog/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1290346

Hi mkaess, did the response provided by amira.bedhiafi.pro help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!

Hi mkaess, we’ve noticed that no response has been received from you since the 25th of January. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the checkbox. Thanks!

This got me to where I needed to be. Did it in Power Query which is better in my way of thinking.