Forum Discussion

lancea's avatar
lancea
Icon for Helper I rankHelper I
5 years ago
Solved

Calculate Total for the Current Year

I have the following table:   ID Date Description Date Month Date Year Sales 1 Dec-2020 12 2020 100 2 Jan-2021 1 2021 100 3 Jan-2021 1 2021 50 4 Feb-2021 2 2021 1...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi lancea 

    You can create measures to return Overall Year Total and Average Year Total .

    Monthly total = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Date Description]))

    Overall Year Total = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Date Year]))

    Average Year Total = [Overall Year Total]/CALCULATE(DISTINCTCOUNT('Table'[Date Description]),ALLEXCEPT('Table','Table'[Date Year]))

    Then put the measures with fields ‘Date Description’ and ‘Date Year’ in a new table visual ,like this

    In ‘Date Year’ filter , filter out data for 2020 .

    I have attached my pbix file , you can refer to it .

     

    Best Regards

    Community Support Team _ Ailsa Tao

     

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