Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
TommyWommy
Frequent Visitor

How to Create an column that creates an ID# based on multiple criteria and last instances?

Hi,

I'm relatively new to Power BI, and I'm trying to do something that I'm not even sure is possible.

 

I have a table that is similar to the one below. I am trying to create an ID number for "events". The events always follow the same process in the status column:

 

Step 1 - Engineer Required

Step 2 - Engineer on machine

Step 3 - Repair Complete

 

They are in date order, across multiple machines. Is there a way of creating a unique value for each "event"? 

 

 

MachineStatusDateTime Raised
Machine 1  Repair Complete25/03/2022 15:04
Machine 1Engineer on machine  25/03/2022 15:03
Machine 1Engineer Required25/03/2022 14:57
Machine 2Repair Complete25/03/2022 14:52
Machine 2Engineer on machine25/03/2022 14:52
Machine 1Repair Complete25/03/2022 14:51
Machine 2Engineer Required25/03/2022 14:51
Machine 1Engineer on machine25/03/2022 14:51
Machine 2Repair Complete25/03/2022 14:46
Machine 2Engineer on machine25/03/2022 14:38
Machine 1Engineer Required25/03/2022 14:36
Machine 2Engineer Required25/03/2022 13:51
2 REPLIES 2
amitchandak
Super User
Super User

@TommyWommy . Do you need a unique number in each row ?

 

For that, you can add an index column in Power Query

Power Query- Index Column: https://youtu.be/NS4esnCDqVw

 

Another option is have column Rank in DAX, that is based on a combination of columns

Column Rank: https://www.youtube.com/watch?v=wDS_Vi4r9I4&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=39

 

For Rank
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

No, I do not need a unique number in each row.

I would like to find all instances of "engineered required" for any given  machine. Then find the next instance of "engineer on machine" and then "repair complete". Then group that together as 1. But apply a unique value everytime it happens.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.