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
Hi,
I have a formula for calculating our estimated finishing time:
Total Totes / 700 = Time remaining
Time remaining + Now = Estimated Finsihing Time
The issue I am having is that everything is working off datetime and not just time.
For example, yesterday at 4pm the formual would be:
3426 / 700 = 4.8942 (which translates to roughly 4 hours and 53 mins)
4.8942 + 16:00:00 = 20:53:00 (estimated finishing time)
But running this now for yesterdays time gives me an answer of "12/05/2022 10:07:45"
Is there a way to do calculations without the date being involved?
or is there a simpler way to calculate time by adding decimals?
Solved! Go to Solution.
Hello @billhawley
Thanks for sending across the data. The main issue with your measure is that it does not take into account the max time when the values are non blank correctly. As a result, it returns the max non-blank value, rather than the last non-blank value. I have managed to recreate your dataset and achieve the desired output. Please take a look :
Table : FinishingTimes
1) Compute max non-blank time and extract the hour and minute components
2) Compute each of the tote values. Please note the added filters where we compare the hour and the minute of the time value with those of the max time. This ensures only the last row is picked up
3) Compute the total values, convert to hours, and find the finishing time
The measure is available below for your reference :
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊
To add on as another example, this mornings numbers are:
705+680+578+21 = 1984
1984 / 700 = 2.834 (roughly 3 hours)
2.834 + NOW()
The answer I expect - 13:19
The answer Power BI is giving me - 15/05/2022 06:18:00
Hi @billhawley ,
Please try this :
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos ! 😊
Hi Rohit,
That works, but only for static values, the number we need to add changes every 30mins based on another formula. I have swapped out 2.834 for the formula and added in the ,0,0 and I am not getting any errors but I am getting: 13/05/2022 02:06:41
Which is defintily not ~3 hours
Hi @billhawley,
Please try this :
I think I know what the problem may be.
In my formula I use LASTNONBLANK, instead of giving me the actual last non blank value it is giving me the highest value from each column.
Would you know the best way to pick the actual last non blank value from the table?
Thanks for your help so far!
Hi @billhawley ,
Would it be possible for you to share sample data?
Kind regards,
Rohit
Hi Rohit,
Not sure if you can see that but that is the total dataset.
My formula is:
TotesSnapshot = LASTNONBLANK(Belt1Customer1Totes,1) + LASTNONBLANK (Belt1Customer2Totes,1) + LASTNONBLANK(Belt2Customer1Totes,1) + LASTNONBLANK(Belt2Customer2Totes,1)
TotesSnapshot / 700 = Time in decimals
Now + Time = Estimated Finishing Time
What I would like it to do is use the numbers that are underlined, but the formula is instead using the largest numbers from those columns.
So it should look like this:
TotesSnapshot = 806 + 286 + 1996 + 15 = 3103
3103 / 700 = 4.4328 (4 hours 25 mins 58 secs)
Now (13:15) + 4.4328 = ~17:40
Hello @billhawley
Thanks for sending across the data. The main issue with your measure is that it does not take into account the max time when the values are non blank correctly. As a result, it returns the max non-blank value, rather than the last non-blank value. I have managed to recreate your dataset and achieve the desired output. Please take a look :
Table : FinishingTimes
1) Compute max non-blank time and extract the hour and minute components
2) Compute each of the tote values. Please note the added filters where we compare the hour and the minute of the time value with those of the max time. This ensures only the last row is picked up
3) Compute the total values, convert to hours, and find the finishing time
The measure is available below for your reference :
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊
It worked!
Thank you so much!
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 |