Forum Discussion

sokg's avatar
sokg
Icon for Solution Supplier rankSolution Supplier
9 years ago
Solved

Help with Line chart shows current TOTALQTD and Last Year same TOTALQTD

Hello to all,

 

I have  Sales = SUM(SalesValue). I have a date table with dates from 1/1/2016.

 

I have created QTDSales= TOTALQTD([Sales],DATESQTD(dCalendar[Date])) and

PY QTDSales = CALCULATE([QTDSales],DATEADD(dCalendar[Date],-1,YEAR))

and I want to see only current QTD compared with LY QTD.

Instead I see all QTD’s.

What am I doing wrong????

 

Thanks in advance

  • I fix it using these formulas:

     

    QTDSales = CALCULATE(TOTALQTD([Sales];DATESQTD(dCalendar[Date]));dCalendar[Quarter No]=ROUNDUP(MONTH(TODAY())/3;0);dCalendar[Year]=YEAR(TODAY()))

     

    and

     

    PY QTDSales = CALCULATE([Sales];DATEADD(DATESQTD(dCalendar[Date]);-1;YEAR);dCalendar[Quarter No]=ROUNDUP(MONTH(TODAY())/3;0);dCalendar[Year]=YEAR(TODAY())-1)

     

    Thank you all, for your replies.

6 Replies

    • sokg's avatar
      sokg
      Icon for Solution Supplier rankSolution Supplier

      I want to see only the last quarter. The part from 1/4/2017 till today.

      • vanessafvg's avatar
        vanessafvg
        Icon for Community Champion rankCommunity Champion

        sokg

        QTD doesn't refer to the latest quarter as far as i know it just rolls it up at a quarter level

         

         

         

  • sokg's avatar
    sokg
    Icon for Solution Supplier rankSolution Supplier

    I fix it using these formulas:

     

    QTDSales = CALCULATE(TOTALQTD([Sales];DATESQTD(dCalendar[Date]));dCalendar[Quarter No]=ROUNDUP(MONTH(TODAY())/3;0);dCalendar[Year]=YEAR(TODAY()))

     

    and

     

    PY QTDSales = CALCULATE([Sales];DATEADD(DATESQTD(dCalendar[Date]);-1;YEAR);dCalendar[Quarter No]=ROUNDUP(MONTH(TODAY())/3;0);dCalendar[Year]=YEAR(TODAY())-1)

     

    Thank you all, for your replies.