Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Help with totals

Hello! I have made a chart showing the sales per region/quarter/year and company size.

 

Sales is on the y-axis, company size is x axis and the legend contains region/qtr/year. On the legend, I also need to have worldwide/qtr/year. Aka TOTAL sales for all three other regions for each quarter and year.

 

Not sure if this makes sense, but I just need some help figuring out how to get one of the columns to be WW/total sales for each quarter and year.

 

thanks! 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    You could sum the sales group by quarter and year like

    Total group by year and quarter =
    CALCULATE (
    SUM ( 'TABLENAME'[SALES] ),
    FILTER (
    ALLSELECTED ( 'TABLENAME' ),
    [YEAR] = MAX ( 'TABLENAME'[YEAR] )
    && [QUARTER] = MAX ( 'TABLENAME'[QUARTER] )
    )
    )

    DAX ALLSELECTED Function Explained: Syntax & 3 Easy Examples - Learn | Hevo (hevodata.com)

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

2 Replies

  • Hi there!

    If I understood correctly, you could solve this by creating a measure like this:

    CALCULATE(

    SUM( SalesColumn ),

    ALL( Table[Region] )

    )

    Let me know if that helps!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could sum the sales group by quarter and year like

    Total group by year and quarter =
    CALCULATE (
    SUM ( 'TABLENAME'[SALES] ),
    FILTER (
    ALLSELECTED ( 'TABLENAME' ),
    [YEAR] = MAX ( 'TABLENAME'[YEAR] )
    && [QUARTER] = MAX ( 'TABLENAME'[QUARTER] )
    )
    )

    DAX ALLSELECTED Function Explained: Syntax & 3 Easy Examples - Learn | Hevo (hevodata.com)

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.