Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

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...
  • TomMartens's avatar
    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