Forum Discussion
MrMP
Helper III
6 years agoMeasure totals incorect using IF
Hello everyone, I saw this issue many times, but I just cant seem to fix it. I am working with sales data (Product hierarchy, customers, Locations etc). Currently model has 2 calendars. One a...
- 6 years ago
Hi MrMP
You might try something like :
CALCBF_New = VAR _table = SUMMARIZE ( Table1, Table1[column], "_Value", [measure] ) RETURN IF ( HASONEVALUE ( Table1[column] ), [measure], SUMX ( _table, [_Value] ) )
AllisonKennedy
Community Champion
6 years agoTo troubleshoot this, I find it helps if you break the parts into pieces, and add each of them to your table with totals on. So add Price using calendar 1, price using calendar 2, quantity from calendar 1 all to the table along with totals.
To fix it, you can either fix each of those parts so that they have the total you expect, or you can fix the IF statement.
Either way, you will likely need to use a SUMX to calculate row by row and then apply the sum of each result as the tables. Try doing the SUMX(fact table, IF( .... )) as a starting point.
To fix it, you can either fix each of those parts so that they have the total you expect, or you can fix the IF statement.
Either way, you will likely need to use a SUMX to calculate row by row and then apply the sum of each result as the tables. Try doing the SUMX(fact table, IF( .... )) as a starting point.