The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a table for a production line, where each row is an individual product. One column contains the date and time where production started.
I want to calculate the time elapsed between this date, and the start of production of the last product made before (cycle time).
In other words, in a list of dates I want to identify the latest date before the date of each row.
In Access I can do that by duplicating the table_1 to table_2, and looking for the maximum date in table_2 which is smaller than the current date in table_1.
In Power BI query I cannot figure out how to make this simple operation.
Any help will be greatly appreciated !
Regards
Solved! Go to Solution.
Hi,
Try this calculated column
=CALCULATE(MAX(Data[Date_Time]),FILTER(Data,Data[Date_Time]<EARLIER(Data[Date_Time])))
Hope this helps.
Hi,
My formula has to be written as a calculated column - not as a measure.
Hi,
Try this calculated column
=CALCULATE(MAX(Data[Date_Time]),FILTER(Data,Data[Date_Time]<EARLIER(Data[Date_Time])))
Hope this helps.
Hi,
I've tried this solution but there goes an error (circular reference)
Could you please help?
Hi,
My formula has to be written as a calculated column - not as a measure.
yes, in this way I tried back in March, and it worked !
thank you again
You are welcome.
Hi, I tried this solution and but it's not working ( a circular reference)
Could you help please?
Seems good at 1st test. Thanks !
You are welcome.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
78 | |
66 | |
52 | |
50 |
User | Count |
---|---|
121 | |
120 | |
78 | |
63 | |
62 |