Forum Discussion

CJLewis87's avatar
CJLewis87
Frequent Visitor
2 years ago

Creating a Episode reference with DAX based on start and end dates across multiple rows

Hi All

I am trying to use DAX to create a unique episode reference for each row that is part of a single episode. As a starting point I have already created unique Index in Power Query for each person as defined by their ID number before loading into my report.

 

An episode should be a collection of all rows for the same Index number whereby the Finance Start Date is either the same as the previous rows Finance End Date or +1 days. So for Index 0, I want all 3 of those rows to be assigned the same ID number as the dates are consectutive from 04/01/18 to 21/02/18. If there was then another entry with a break in dates, I'd want a new reference creating and so on and so forth.

 

Many thanks in advance!

3 Replies