Forum Discussion
Need help with DAX
- Anonymous2 years ago
Hi heygau ,
Thanks for Musadev sharing. Please refer to my steps have a try.
Stock on Hand = VAR OpeningBalance = 27192 VAR CumulativeReceivals = CALCULATE ( SUM ( Receivals[Quantity] ), FILTER ( ALL ( 'DateTable' ), 'DateTable'[Date] <= MAX ( 'DateTable'[Date] ) ) ) VAR CumulativeSales = CALCULATE ( SUM ( Sales[Quantity] ), FILTER ( ALL ( 'DateTable' ), 'DateTable'[Date] <= MAX ( 'DateTable'[Date] ) ) ) RETURN OpeningBalance + CumulativeReceivals - CumulativeSalesHow to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Musadev
I want to calculate
Stock on hand = [(Opening Balance + Bales Received) - Bales Sold]
I have to consider the opening balance from June 2023 and should continue with the result value on the Stock on hand column.
Bales Received is a measure = SUM(Bales Received ) and Bales Sold as well, from multiple tables. Thanks.