Implementing running total from arbitrary dates in DAX - Unplugged #34

  Рет қаралды 9,465

SQLBI

SQLBI

Күн бұрын

Create a running total formula in DAX that starts from arbitrary dates instead of considering the complete history available.
Read more about the "unplugged" format: www.sqlbi.com/blog/marco/2021...
#unplugged

Пікірлер: 31
@henrifanda4784
@henrifanda4784 2 жыл бұрын
You always make it so easy. Hats off to you. Watching your DAX magic works is so satisfying. Thanks Alberto.
@csgexec
@csgexec 2 жыл бұрын
Great job. I’m glad to see you took the time to optimize the calculations into a single measure. 👍🏼
@JonathanCHANAL
@JonathanCHANAL 2 жыл бұрын
Hello, this is very useful as always, and I have to say, this is just impressive how it seems so easy for you. I hope I'll have such confidence in a few years. Thank you very much for sharing so many things with us.
@hoezo
@hoezo 2 жыл бұрын
Great video thank you! I am now trying to apply this logic on resetting the Running Total on a specific time each day.
@filipedossantos5569
@filipedossantos5569 2 жыл бұрын
It's a fantastic job. It's always a pleasure to see a video of someone who really knows the tool they work with. I leave the suggestion to build in DAX the simple linear regression. Currently the suggested DAX formulas only work on an annual or daily level but not correctly on a quarterly or monthly level, at least not when comparing with the results in Excel or maybe is just me that isn't properly applying those solutions.
@SQLBI
@SQLBI 2 жыл бұрын
See this article: sergiomurru.com/2021/06/14/simple-linear-regression-in-dax-with-hierarchy-on-date-table/
@filipedossantos5569
@filipedossantos5569 2 жыл бұрын
@@SQLBI thank you. Really thank you. At least, for me, I think that this is a really important article.
@esaegess
@esaegess 3 ай бұрын
Thank you so much for your videos. I've got a different setup and I'm not able to combine actuals and forecast. Actuals are on a daily bases and forecast is on a yearly bases. For my combined actuals and forecast, I've got to a) subtract the total of the actuals from the total forecast (one value for the year) and b) calculate the daily forecast for all days after the latest actual. Would be great if you could get in touch with me or if you could create another great video ;-). Thank you!
@JohnSullivan1
@JohnSullivan1 2 жыл бұрын
Fantastic. Thank you Alberto!
@alexsandersilva7402
@alexsandersilva7402 2 жыл бұрын
Amazing. Thank you.
@caleboud
@caleboud 2 жыл бұрын
Thanks for this video , as usual very clearly explained. I was just wondering if I could adapt your code and use it to do a running total between dates. Suppose you have 2 slicers where you can select a start date and an end date…
@EST1865
@EST1865 2 жыл бұрын
Your DAX is immaculate
@johansantacruz6464
@johansantacruz6464 2 жыл бұрын
I would like to get this performance improvements in my measures. Thanks Alberto!
@user-sb5vf7qq1e
@user-sb5vf7qq1e 2 жыл бұрын
SQLBI Never let you down!!! Thanks for your video. I have a thought, if the interval between each reset date is fixed, is it a good idea to set up a calculated column in the Date table to show the Last Reset date so that we can apply Datesbetween function always horizontally in Dates table directly. It will save somehow the vertical scan resources, right?
@pbihari0214
@pbihari0214 2 жыл бұрын
Thank you
@AB-nx5rl
@AB-nx5rl 2 жыл бұрын
Hi Alberto. Would it be possible for you to post a similar video on SQLBI or here in which you demonstrate how the running total "curve" gets adjusted to a start date and end date that are selected via a date slicer. Basically I select a time period on a slicer and the cumulative curve starts from 0 in correspondence of the min date selected via the slicer and the max date is the max date of the selection.
@todortodorov9472
@todortodorov9472 Жыл бұрын
Even your video is complex for my knowledges, explanation makes it easy. It's very useful for me, thanks Alberto! I'm trying to create more complex logic for resetting - two (for now) or (even) more triggers. For example: Town | Type | SubType | Qty | RT Qty 1 | 1 | 1 | 5 | 5 1 | 1 | 2 | 4 | 9 1 | 1 | 1 | 2 | 11 1 | 1 | 2 | 3 | 14 1 | 1 | 3 | 6 | 20 2 | 1 | 1 | 1 | 1 2 | 1 | 1 | 7 | 8 2 | 1 | 2 | 3 | 11 2 | 1 | 1 | 5 | 16 2 | 1 | 2 | 6 | 22 2 | 1 | 3 | 8 | 8 2 | 1 | 4 | 14 | 22 2 | 1 | 5 | 2 | 2 2 | 2 | 1 | 4 | 6 2 | 2 | 2 | 8 | 14 3 | 2 | 2 | 2 | 16 3 | 2 | 3 | 3 | 19 In my table I have no dates, information is sorted with index column. Triggers: 1. If Town is changed in case that Type is 1. RT Quantity defenetelly need to be reset, even if there is enough space. In example, row with Qty = 1 need to be in different RT Qty than first 5 rows. 2. If Type is not 1, even on changes of town, RT Quantity need to be reset when reach maximum level, in example 22. Tried to make measure [Reset] more complex (with logic above). Reaching trigger row (LastReset), RT is reset, but on next row RT is not correct and calculate RT from first row of the table, not from LastReset. Noticed that using RowsToUse variable instead of DatesToUse, need to filter table from LastReset to current row. Used FILTER(; [Index] >= LastReset && [Index]
@dankotsmith9459
@dankotsmith9459 Жыл бұрын
I have a OrderFactTable that has an OrderDate. I need to calculate a RunningTotal on a Patient Level for 45 days when a certain trigger happens on that patient. In this instance the Trigger would be when it has been over 90 days since their previous order. Any thoughts on that?
@nishantkumar9570
@nishantkumar9570 2 жыл бұрын
Thank you very much. Could you please simulate the FIFO concept of inventory using DAX. I love the way you explain things so beautifully and easily. You make every concepts very clear. Thank you very much.
@SQLBI
@SQLBI 2 жыл бұрын
FIFO requires recursion, which is not available in DAX. There are workarounds but we didn't have time to work on that extensively yet. It's in our backlog, but no date yet.
@chrismettler136
@chrismettler136 2 жыл бұрын
@@SQLBI excellent video as always. A FIFO sample would be wonderful :-)
@nishantkumar9570
@nishantkumar9570 2 жыл бұрын
@@SQLBI thank you very much.... I guess all the 'X' functions un DAX is iterative or recursive... I'll eagerly be waiting for the video. Thank you once again.
@SQLBI
@SQLBI 2 жыл бұрын
X functions are iterators (see them on dax.guide). DAX does not have recursion.
@aniruddhmathur3535
@aniruddhmathur3535 2 жыл бұрын
If date is same ..and running total is calculated as per group by then how I can apply DAX
@christinelowery2415
@christinelowery2415 11 ай бұрын
What if I need the ref date to be the selected date plus 28 days? How would I write that?
@christinelowery2415
@christinelowery2415 11 ай бұрын
Every week needs to be the total of 4 weeks (itself plus next3). It rests each week
@Wolfangs88
@Wolfangs88 2 жыл бұрын
Is there a DAX formula for running total since the beginning of the year ?
@SQLBI
@SQLBI 2 жыл бұрын
Look for year-to-date calculations. www.daxpatterns.com/standard-time-related-calculations/
@mdnaiyaz9177
@mdnaiyaz9177 2 жыл бұрын
How to find running total of last 5 days, Date value answer 1. 10. 10 2. 20. 30 3. 30. 60 4. 40. 100. 5. 50. 150 6. 60. 60 7. 70. 130 8. 80. 210 9. 90. 300 10. 100 400 15. 50. 50 16. 30. 80 17. 20. 100 Need DAX for Answer column
Understanding context transition
18:25
SQLBI
Рет қаралды 63 М.
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 68 МЛН
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 4,1 МЛН
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 10 МЛН
Using ALLEXCEPT vs ALL VALUES
13:35
SQLBI
Рет қаралды 52 М.
Problems with PivotTable Running Totals and HOW TO FIX THEM
8:12
MyOnlineTrainingHub
Рет қаралды 45 М.
Power Query - Faster & Easier Parameters
13:38
BCTI
Рет қаралды 33 М.
Power BI: Hiding future dates for calculations in DAX
12:31
Guy in a Cube
Рет қаралды 47 М.
When to use KEEPFILTERS over iterators
18:56
SQLBI
Рет қаралды 47 М.
Running Total in Power BI (for Date and Non Date Values)
9:05
WWDC 2024 - June 10 | Apple
1:43:37
Apple
Рет қаралды 10 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 6 МЛН
One To Three USB Convert
0:42
Edit Zone 1.8M views
Рет қаралды 441 М.