Forum Discussion
Anonymous
7 years agoNot applicable
DAX calculation help
Hi Need your help and suggestion on achieveing the below I have sample data like below. ID Transaction Type Qty From Date Todate 1234 Opening Stock 50 3/11/2019...
- 7 years ago
hi, Anonymous
If you could try this measure
SpoilerMeasure = var _frodate=CALCULATE(MIN('Date'[Date]))var _todate=CALCULATE(MAX('Date'[Date])) returnIF(SELECTEDVALUE('Table'[Transaction Type])="Opening Stock",CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[From Date]=_frodate)),IF(SELECTEDVALUE('Table'[Transaction Type])="Closing Stock",CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[Todate]=_todate)),IF(SELECTEDVALUE('Table'[Transaction Type])="Received",CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[From Date]>=_frodate&&'Table'[Todate]<=_todate)))))result:
and here is pbix file, please try it.
Best Regards,
Lin
Anonymous
7 years agoNot applicable
Hello Gurus,
Please can some one reply . Thanks in Advance
Regards
Siva