Forum Discussion
Anonymous
8 years agoNot applicable
Help with SUMX: Calculating Total Sales
Hi Everyone, Okay so i have the following table (SALES) which i am importing in to PowerBI using Power Query: Ret Trans Type Style Barcode Date Sales Value Sales Units S 5053366373...
- 8 years ago
Hey,
first I created these two measures
Total Sales Units = SUM('Table2'[Sales Units])and
Total Sales Value = SUM('Table2'[Sales Value])Then I created this measure
Total Sale SUMX = SUMX( VALUES(Table2[Style Barcode]) ,[Total Sales Units] * [Total Sales Value] )Instead of itereating across the table I'm iterating across the filtered barcode(s)
I guess this returns what you are looking for:
Regards,
Tom
Anonymous
8 years agoNot applicable
Hi Anonymous,
I had already attempted to create a Calculated Column, however, the second record would be incorrect that way.
This is is again due to having two seperarte records for Barcode: *1951 each having 1 Unit
Thanks for your responce :)
| Style Barcode | Sales Value | Sales Units | Total Sales A | Sales Tot B | Total Sales Calculated Column |
| 505336637308 | 89.16 | 2 | 178.32 | 178.32 | £178.32 |
| 505336771951 | 96.59 | 2 | 193.18 | 96.59 | £96.59 (Wrong) |
| £185.75 | £4.00 | £371.50 | £274.91 | £274.91 |
TomMartens
Super User
8 years agoHey,
try the solution I creaed, it looks pretty close to what you are looking for at least to me.
Regards,
Tom