The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a table with new entries every time the status of a machine is updated. A Created Time is automatically added when a new entry is created. What I would like to make is a column for End Time. It should be the Created Time for the next entry for that particular machine. Any help would be greatly appreciated!
Solved! Go to Solution.
Hi @Anonymous
Try this:
END Time =
VAR _A = [Created]
VAR _End =
CALCULATE (
MIN ( 'Table'[Created] ),
FILTER (
ALL ( 'Table' ),
'Table'[Machine] = EARLIER ( 'Table'[Machine] )
&& 'Table'[Created] > _A
)
)
RETURN
_End
if the output you are looking is as follow:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi @Anonymous
Try this:
END Time =
VAR _A = [Created]
VAR _End =
CALCULATE (
MIN ( 'Table'[Created] ),
FILTER (
ALL ( 'Table' ),
'Table'[Machine] = EARLIER ( 'Table'[Machine] )
&& 'Table'[Created] > _A
)
)
RETURN
_End
if the output you are looking is as follow:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
@VahidDM thanks for the response! I just got back to the office and tried this, and I got this error for Line 8:
A single value for column 'Machine' in table 'Table' cannot be determined.
Any suggestions on what I'm still doing wrong?
@VahidDM I figured it out! It was me being stupid. But now I'm slightly less stupid! Thanks for the help!
@Anonymous
It should be the Created Time for the next entry for that particular machine - what is the logic for calcuating that
It's from a SharePoint list. So someone creates an entry (e.g. for machine 1), and it has a created time. Then the next time the status changes, they create a new entry for machine 1, and that also has a created time. There could be entries for other machines between there, so it needs to be the next entry for the same machine.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |