Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to calculate inventory days (meaning how long time will the item theoretically be on stock from now on, based on history) with this measure:
Inventory QTY is a measure in itself:
Item | Inventory valuation | Outflow Value 3M | Inventory QTY | Inventory days |
A | 100 | 150 | 3 | 60 |
B | 200 | 150 | 4 | 120 |
C | 150 | 0 | 0 | |
Total | 300 | 450 | 7 | 60 |
But the issue there is, that for Item "C" the outflow value of 150 does not have any influence really on the row for item "C", but on the total the 150 is included, for calculation purpose this would be the right result regarding inventory days:
Item | Inventory valuation | Outflow Value 3M | Inventory QTY | Inventory days |
A | 100 | 150 | 3 | 60 |
B | 200 | 150 | 4 | 120 |
Total | 300 | 300 | 7 | 90 |
Hi @Morten_DK ,
Can you put some sample data here with expected result and current result?
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
I have updated the original post with some sample data, hope that helps 🙂
@Morten_DK ,
Here's your solution DAX:
Inventory Days2 =
DIVIDE(
CALCULATE(
SUM('Table (3)'[Inventory valuation]),
'Table (3)'[Inventory valuation] <> BLANK()
)*90,
CALCULATE(
SUM('Table (3)'[Outflow Value 3M]),
'Table (3)'[Inventory valuation] <> BLANK()
)
)
Please make other changes accordingly because I have created the DAX according to the data your provided.
Result:
Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!! Proud To Be a Super User !!! |
Thanks for the feedback. I can't get the proposed solution working, as "Inventory valuation" is also a measure
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
99 | |
92 | |
50 | |
49 | |
46 |