Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi everyone, i looked arround and since i'm no math guru i really need help coming up with a solution for this problem, i need to replicate this logic:
January | February | March | April | |
Sell Out | 17 014 679,20 | 16 188 004,97 | 22 978 536,89 | 20 032 740,21 |
Sell In | 19 980 043,44 | 20 248 217,04 | 24 824 416,44 | 21 868 254,12 |
Estimation Stock | 2 965 364,24 | 7 025 576,31 | 8 871 455,86 | 10 706 969,77 |
So Estimation Stock for January is just Sell In - Sell Out but for Feburay it's (Sell In - Sell Out) + Estimation Stock of January
I tried to come up with 3 measures to do that but no luck so far, kinda stuck actually, i dunno if the problem is algorithmic as it seems that it needs Recursion or there's a simple workarround that i'm not able to see, here's the 2 Dax Measures that i wrote for it:
This measure calculates the differance
Estimation Stock =
VAR CurrentMois= SELECTEDVALUE('Période'[TheDate].[NoMois])
VAR PreviousMonthEstimationStock= CALCULATE([Estimation Stock],PREVIOUSMONTH('Période'[TheDate]))
RETURN
IF( CurrentMois = 1, [A], PreviousMonthEstimationStock + [A]
)
Obviously this will not run as it is self referencing itself,it's just to help you understand the logic.
Can anyone help me about it ?
Solved! Go to Solution.
Hi @ChouaibBenali ,
We can calculate the cumulative Sell-In minus the cumulative Sell-Out, and hopefully the following expression will inspire you.
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Hi @ChouaibBenali ,
We can calculate the cumulative Sell-In minus the cumulative Sell-Out, and hopefully the following expression will inspire you.
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
@ChouaibBenali Generally recursion is not possible. However, in your case you may be able to get around that limitation by creating a measure for Previous Month Estimation Stock, Current Month Estimation Stock and your A measure.
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
15 | |
11 | |
10 |