Mar 24 2022 07:26 AM
I would expect in the below example that in the column "ReplByQty", the first row would be 45 + 14 = 59.
What am I doing wrong?
Attached the sample workbook.
Mar 24 2022 07:39 AM
SolutionThat is
=VAR currentSKU=Table1[SKU]
RETURN CALCULATE( SUM( Table1[Qty] ),
FILTER( Table1, Table1[ReplBy] = currentSKU ) )
Variable is evaluating first and fixed in Returned formula
Mar 24 2022 07:54 AM
@Sergei Baklan Fabulous, thank you!
Just for my understanding, why doesn't it work without the variable?
Mar 24 2022 08:05 AM
@bartvana , you are welcome.
In brief, you fix current row content for scanning the table evaluating formula, without that it is not fixed. It's much better is explained here
Solved: Explanation of the EARLIER formula - Microsoft Power BI Community
EARLIER function (DAX) - DAX | Microsoft Docs
Old Earlier worked practically the same way as now VAR.
Mar 24 2022 07:39 AM
SolutionThat is
=VAR currentSKU=Table1[SKU]
RETURN CALCULATE( SUM( Table1[Qty] ),
FILTER( Table1, Table1[ReplBy] = currentSKU ) )
Variable is evaluating first and fixed in Returned formula