The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hey there,
I have a problem to calculate the ending inventory at below format (Row = item, column = month, value = demands, WorkOrder, On Hand Inv)
Inventory movement = Work Order qty + On hand inventory - demands
The ending inventory = CALCULATE(CALCULATE([Movement],FILTER(ALLSELECTED('Fact'),'Fact'[Date]<=MAX('Fact'[Date]))))
But it works when i only put the date in the row, but not correct when i put item in row, and month in the column. (see below). I think i might also add some dax such as allselected to item level. Would you kindly help? Thanks a lot!
@naoyixue1 , in such case, you should have date in a separate table. Like date table. so all/ allselected on the date table will not impact relation with item
The ending inventory = CALCULATE(CALCULATE([Movement],FILTER(ALLSELECTED('Date'),'Date'[Date]<=MAX('Date'[Date]))))
I also think it should be like
Inventory movement = Work Order qty - demands
The ending inventory = [intial On hand inventory]+ CALCULATE(CALCULATE([Movement],FILTER(ALLSELECTED('Date'),'Date'[Date]<=MAX('Date'[Date]))))
initial On hand inventory; inventory on the start date
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
Appreciate your Kudos.
Thanks Sir for your inputs! Just send private message to you to see whether you have time to look at my table setting. Thanks!
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
5 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |