Forum Discussion

Todward's avatar
Todward
Frequent Visitor
6 years ago
Solved

Line Chart with YTD average figures

Dear all   I would like to create a line chart similar to the one in the screenshot below. However the figures in this chart should not be the monthly figures but the YTD average of this specific m...
  • TomMartens's avatar
    6 years ago

    Hey @Todward ,

    I guess you have a dedicated calendar table, which is related to your fact table. I also recommend reading this article: https://www.daxpatterns.com/time-patterns/

    I create two measures for its volume and COGS as well:

    YTD quantity = TOTALYTD(CALCULATE(SUM('Fact Sale'[Quantity])) , 'Dimension Date'[Date])

    Create a third measure that divides the previous measures accordingly.

    Hopefully, this provides what you're looking for.

    Best regards

    cat