Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Separate year/month column

Hello comunity, I have a problem. I need to separate values for whole year 2018 and then values for year 2019 but by months. Is there any DAX solution so I can take exact year like in SQL? Or do you have any other idea ? 

  • Hi Anonymous 

    You may add Month column and Year column in query editor first.Then create measures like below.Attached the sample file for your reference.

     

    Salary for Year 2019 = CALCULATE(SUM(Table1[Salary]),Table1[Year]=2019)
    AVG for year 2019 = [Salary for Year 2019]/DISTINCTCOUNT(Table1[Month Name])

    Regards,

     

4 Replies