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(...
  • sokg's avatar
    9 years ago

    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.