Forum Discussion
Grouping consecutive dates into a single row
- 5 years ago
See it all at work in the attached file.
I'm getting a bit lost. The example that you show (2504-Z004) has only one row in the data you've shared, with dates 18/01/2021 - 18/01/2021 , so the result you show is the correct one
Most of the Object No in your data have only one row. I had a look at the one with the larger number or rows (you can see them in the query Object Billing Export (TESTS) that I created to help in the debugging and they seem to work fine.
I uncommented the S2_ and S3_ ( to use the latest versions I'd suggested, you had the previous version active) and included sorting by Returned Date on this step, to get the dates completely sorted out before the crucial step:
Sorted by Object No = Table.Sort(#"Reordered Columns",{{"Object No", Order.Ascending}, {"Borrowed Date", Order.Ascending}, {"Returned Date", Order.Ascending}})plus it looks like the error you got (Error - Unable to convert type null to type logical) was caused by cases like
3433-Z062 that had a null not as the very latest date in Borrowed Date. So I temporarily replaced those nulls with a date far in the future (31/12/9999) so that the row gets placed at the end when sorting ascending (the null woud be placed at the beginning since it is treated as as 0). Then at the end convert that 31/12/9999 back to null
Please accept the solution when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
It's working on the data I posted earlier. Share the data you are running it on on an excel file or pbix
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Try this link and let me know how you go. Thanks for all your help! Much appreciated.
- AlB5 years ago
Community Champion
Where is the query? Where is the error?
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- matthewkaess5 years ago
Helper I
That's odd - the error is gone now but the results are incomplete. May be an issue in the actual report not the redacted version.
The query is 'Object Billing Export'
This is all that is being returned now.