Forum Discussion
wiser
4 years agoFrequent Visitor
DAX Measure For Calculating Stocking Levels
Hi all. I am trying to create a DAX formula/measure that calculates necessary stocking levels based on several different inputs. The biggest input is the install base. Even though it is a very ugl...
- 4 years ago
Hey,
I created your table in Excel in Power BI. Above it slicers for the parameters. You can use the following code to calculate 'Tier 1':
Tier 1 = VAR _ProposedCS = SELECTEDVALUE ( ProposedCS[ProposedCS] ) VAR _PropesedLT = SELECTEDVALUE ( ProposedLT[ProposedLT] ) VAR _AnnualUsage = SELECTEDVALUE ( 'Table'[Annual Usage] ) VAR _TT = SELECTEDVALUE ( 'Table'[TTQ] ) RETURN IF ( _ProposedCS * _AnnualUsage > 5, VAR _m1 = MAXX ( { _TT + _TT - 1, ROUNDUP ( DIVIDE ( _ProposedCS * _AnnualUsage, 12 ), 0 ) }, [Value] ) VAR _m2 = ROUNDUP ( DIVIDE ( _ProposedCS * _AnnualUsage, 365 ) * _PropesedLT, 0 ) RETURN _m1 + _m2, 0 )You can use the above code as a basis for calculating the other calculations. Adjust the parameters and conditions for this. Hope this helps.
daXtreme
Solution Sage
4 years agoHi wiser
This looks so messy that I seriously doubt anyone would like to try and decipher this... Might be wrong, of course, but one has to have plenty of time on their hands to deal with such an issue 🙂
Can you please somehow simplify it to only single out the most important bits and make the description more granular/comprehensible? Maybe then people will show more enthusiasm about helping. Just a gentle hint 🙂
Cheers.