Forum Discussion
IF statement totaling issues
Image
- KGrice10 years agoMemorable Member
For troubleshooting, what happens if you change the last part of your upsells measure to 1 instead of 0? Do you get 1 in the totals, or is it still 0?
- avalerion10 years agoFrequent Visitor
A net total shows up rather than only showing the total of individual lines > 0, but many rows have $1 on it (which is incorrect).
- jahida10 years agoImpactful Individual
You need to wrap the measure you currently have in some sort of a SUMX, so it calculates each row and then sums the result instead of calculating the whole table at once.
- avalerion10 years agoFrequent Visitor
I guess since the original formulas that the IF statement is calculating off are both wrapped in SUMX, what would you propose? I tried creating a much bigger formula by joining the two within an IF statement and had no luck.
- jahida10 years agoImpactful Individual
If I understand correctly (I may not), the objective here is to calculate at the row level in the table visual (being done correctly) and then sum those results to get a final total. If that's the case, then you need a SUMX which groups together each row of the table visual, calculates for each, and then sums. SUMMARIZE might be useful:
SUMX(SUMMARIZE(Table, Table[Col1], Table[Col2], "Value", IF(...)), [Value])
Where Col1 and Col2 are the columns of the table that represent rows in the visual.