Forum Discussion

dhirendra59's avatar
dhirendra59
Icon for Helper I rankHelper I
6 years ago
Solved

Need help with Dax - calculate (pull) a value based on max date time aggregate to certain fields

 

Hello All, I need help to create a measure to pull total on hand balance value agregated by warehouse and item number based on max date-time for that particular day with filter transaction type 10. 

 

It should give value 1547 for 7/27, 1576 for 7/28 and 1631 for 7/29 and so on. 

 

Please let me know if you need more information. See attached data

warehouseitem_numberstock_transaction_typetransaction_identitytotal_on_hand_balancetransaction_datetime
7002011510WOP15477/27/2020 7:37
7002011510WOP14387/27/2020 7:38
7002011510WOP16537/27/2020 7:38
7002011510WOP15767/28/2020 8:28
7002011531OID16357/28/2020 15:06
7002011531OID16177/28/2020 15:12
7002011510WOP16407/29/2020 7:19
7002011511WOM16317/29/2020 8:47
7002011531OID15587/29/2020 10:34
7002011531OID15407/29/2020 10:36
7002011531OID15227/29/2020 15:23
  • dhirendra59 , Have date column and try

     

    date = [transaction_datetime].date

    new measure = calculate(lastnonblankvalue(table[transaction_datetime],min(table[total_on_hand_balance])),allexcept(Table,Table[warehouse],Table[item_number], Table[transaction_identity], Table[Date]), Table[stock_transaction_type]=10)

3 Replies