Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi folks
I have the following table with the columns "product", "order_nr", "state_start", "from_state", "to_state" and "state".
I want to calculate the column "state_end" which is always the closest timestamp (depending on the column "product", "order_nr" and "from_state").
If the status is not left, state_end=state_start.
I hope someone can help me
Thanks
Solved! Go to Solution.
Hi @liechpa ,
To create two calculated columns as below.
final date = IF(ISBLANK('Table'[state_end]),'Table'[state_start],'Table'[state_end])
max date = CALCULATE ( MAX ( 'Table'[final date] ), FILTER ( 'Table', 'Table'[Product] = EARLIER ( 'Table'[Product] ) && 'Table'[order_nr] = EARLIER ( 'Table'[order_nr] ) && 'Table'[from_state] = EARLIER ( 'Table'[from_state] ) ) )
Hi @liechpa ,
To create two calculated columns as below.
final date = IF(ISBLANK('Table'[state_end]),'Table'[state_start],'Table'[state_end])
max date = CALCULATE ( MAX ( 'Table'[final date] ), FILTER ( 'Table', 'Table'[Product] = EARLIER ( 'Table'[Product] ) && 'Table'[order_nr] = EARLIER ( 'Table'[order_nr] ) && 'Table'[from_state] = EARLIER ( 'Table'[from_state] ) ) )
@liechpa sorry not very clear about your question? There is no status column in your sample data. Could you please put it in sample excel file and also the logic to get end_time with explanation, it will help to get the solution
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
104 | |
93 | |
83 | |
64 |