Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi, Team please help with the below task.
StartTime | EndTime | Required column |
01/07/2020 12:00:05 AM | 01/07/2020 12:00:07 AM | 0 |
01/07/2020 12:00:06 AM | 01/07/2020 12:00:07 AM | 0 |
01/07/2020 12:00:07 AM | 01/07/2020 12:00:07 AM | 0 |
01/07/2020 12:05:18 AM | 01/07/2020 12:06:52 AM | 1 |
01/07/2020 12:06:42 AM | 01/07/2020 12:06:42 AM | 1 |
01/07/2020 12:06:42 AM | 01/07/2020 12:06:42 AM | 1 |
01/07/2020 12:15:54 AM | 01/07/2020 12:15:56 AM | 2 |
01/07/2020 12:16:03 AM | 01/07/2020 12:16:06 AM | 3 |
01/07/2020 12:16:27 AM | 01/07/2020 12:16:39 AM | 4 |
01/07/2020 12:16:39 AM | 01/07/2020 12:18:30 AM | 4 |
01/07/2020 12:18:30 AM | 01/07/2020 12:19:52 AM | 5 |
01/07/2020 12:20:41 AM | 01/07/2020 12:22:27 AM | 6 |
01/07/2020 12:20:42 AM | 01/07/2020 12:22:27 AM | 6 |
01/07/2020 12:20:42 AM | 01/07/2020 12:22:27 AM | 6 |
01/07/2020 12:22:27 AM | 01/07/2020 12:23:25 AM | 6 |
01/07/2020 12:23:00 AM | 01/07/2020 12:23:15 AM | 7 |
01/07/2020 12:23:00 AM | 01/07/2020 12:28:01 AM | 7 |
01/07/2020 12:23:42 AM | 01/07/2020 12:28:03 AM | 8 |
If we take the 1st Endtime of the column it should be less than or equal to each row of the Starttime then it will make it as one group and grouping should start with 0, 1, 2, 3....
Thank you in advance.
Solved! Go to Solution.
Please find the above image highlighted colors are grouping rule for better understanding, I am expecting the result is "Required Column"
@Anonymous , I tried but I am getting a few diffs. can you check the first column I created is correct as per your conditions?
New Time =
var _ed =[EndTime]
var _2 = maxx(filter('Table',[StartTime] <=_ed),[StartTime])
return _2
Then rank
Rank = RANKX('Table',[New Time],,ASC,Dense) -1
I doubt I have not taken new time correctly here
Hi Amit,
Thank you for your great support and everything perfect but a few rows are unmatched please have look at below those are highlighted in red color font.
@Anonymous , Please change new time column as give below and try
New Time =
var _ed =[EndTime]
var _st =[StartTime]
var _led = maxx(filter('Table', [StartTime] <EARLIER([StartTime])),[EndTime])
var _2 = if(ISBLANK(_led) || [StartTime] > _led ,_ed,_led)
return _2
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |