Forum Discussion

Promethes_2's avatar
Promethes_2
Icon for Helper II rankHelper II
9 years ago
Solved

Line and Stacked Column Chart - Display Total with quarter series

I'm struggle with getting this to work as I hope and am wondering if someone can provide a littel insight.   I have the following Line and Stacked Column Chart     The issue is when I add To...
  • v-huizhn-msft's avatar
    9 years ago

    Hi Promethes_2


    >>The issue is when I add Total Sales YTD to the Line Values the line isn't drawn showing the total sales per year.

    There are four values according to each quarter when you add Total Sales YTD. It’s confusing to match which value when draw the line. So the line isn't drawn showing the total sales per year.

    >> But if I remove the Quarter column series than it works as expected although not what I'm after.

    The total is not categorized by quarter when you remove the Quarter column series. There is one value based on each year, and drawing line works.

    For your issue, please refer to the following solution.

    First, you’d better to create a column which returns the year and quarter of the date in table. Then you create a another column to calculate the total sum of each year using the formulas below.

     

    Year-Quarter = CONCATENATE(YEAR(Sales[Date]),CONCATENATE("Q",ROUNDUP(MONTH([Date])/3,0)))
    Total-Year = CALCULATE(SUM(Sales[Sales]),ALLEXCEPT(Sales,Sales[Year]))



    Finally, drag the Year-Quarter from fields to Line values when you create a Line and Stacked Column Chart. The value in each year is same, so you can select the Max or Min(the result is same) to summarize the line value avoid using Sum. You will get the expected result like the following screenshot.

     

    If this is not what you want, please share us more details or the sample date for further analysis.

    Best Regards,
    Angelia