Page 1 of 1

SUMX result in power pivot

Posted: Fri Nov 22, 2019 10:50 am
by Dibritti
Hello,

I´m very new in dax, so I please call for your help and patience,

I have an issue to wright the SUMX formula in Power pivot,

I can't get the formula to give me a simple result of multiplying the column X with column Y
This is my formula:

=SUMX(Base;Base[Price]*Base[Quantidade])

the result is wrong and it repeats (same result) in every rows in the table and the data in each row is different
ex: of result:
Column base[price] = 1200
column base[quantidade] = 12
result column = 2228924522,89161

Can you please help ?

Best regards,

Re: SUMX result in power pivot

Posted: Tue Jan 14, 2020 2:20 pm
by RamanaV
SUMX is an aggregation function. That is why you are getting the same result (which is actually the sum of all the products) in every row.
You can add a calculated column as
= Base[Price]*Base[Quantidade]
And, it serves the purpose.

However, it is not a good practice to add a calculated column in the data model.
There are some best practices you need to follow while using Power Pivot.
Please refer to Matt Allington's blog articles here.
https://exceleratorbi.com.au/calculated ... sures-dax/
https://exceleratorbi.com.au/best-pract ... -power-bi/

If you need to add a column, do it in Power Query and not in the data model.
I have shown the differences in the attached workbook.
Hope it is helpful