Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

MTD for current year only

Can someone help me with calculating MTD for current year only

Thanks Jamie

  • Anonymous As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

    https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/

     

    Now you can add a measure for MTD

     

    MTD Sales = CALCULATE ( SUM ( Table[Sales] ), DATEMTD ( Calendar[Date] ) )

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

     

  • Hi Anonymous ,

     

    You may create a calendar table first of all, then create relationship with your fact table on the date field.

     

    Calendar= CALEANDARAUTO()

     

    Then you may create measure like DAX below.

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Calendar'[Date]))

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

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

3 Replies

  • Anonymous As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

    https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/

     

    Now you can add a measure for MTD

     

    MTD Sales = CALCULATE ( SUM ( Table[Sales] ), DATEMTD ( Calendar[Date] ) )

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

     

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi Anonymous ,

     

    You may create a calendar table first of all, then create relationship with your fact table on the date field.

     

    Calendar= CALEANDARAUTO()

     

    Then you may create measure like DAX below.

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Calendar'[Date]))

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

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