Hi,
I am trying to create a new column in Power BI that will allow me to group my data by a subset of the entire table. Here is what I am trying to accomplish.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Event Number[/TD]
[TD]Unit[/TD]
[TD]Status[/TD]
[TD]Group Number[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Truck[/TD]
[TD]DP[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Car[/TD]
[TD]DP[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Truck[/TD]
[TD]AM[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Car[/TD]
[TD]AM[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Truck[/TD]
[TD]DP[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]5522[/TD]
[TD]Truck[/TD]
[TD]DP[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
The Group Number column is what I need to create and is based on the following:
1. Group by Event Number and Unit
2. The Group Number is autogenterated
3. The Group Number starts when the status is DP end then restarts at the next DP within the same Event Number and Unit group
How can I do this?
Thanks in advance!
I am trying to create a new column in Power BI that will allow me to group my data by a subset of the entire table. Here is what I am trying to accomplish.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Event Number[/TD]
[TD]Unit[/TD]
[TD]Status[/TD]
[TD]Group Number[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Truck[/TD]
[TD]DP[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Car[/TD]
[TD]DP[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Truck[/TD]
[TD]AM[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Car[/TD]
[TD]AM[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Truck[/TD]
[TD]DP[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]5522[/TD]
[TD]Truck[/TD]
[TD]DP[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
The Group Number column is what I need to create and is based on the following:
1. Group by Event Number and Unit
2. The Group Number is autogenterated
3. The Group Number starts when the status is DP end then restarts at the next DP within the same Event Number and Unit group
How can I do this?
Thanks in advance!