Forum Discussion

Murali777's avatar
Murali777
Helper III
4 years ago
Solved

Monthwise total using DAX

Hi,

 

Below is my request to figure out the MonthwiseTotal column using DAX measure. I have tried using TotalMTD function but it is working. Can any one pls help on this.

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    The table

    the measure ==>

     

  • Anonymous's avatar
    Anonymous
    4 years ago

    hi Murali777 

     

    You can use this measure

    MonthwiseTotal = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[End Of Month]))
     

    If this post helps, accept it as a solution.

10 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI

     

    Calculate(sum(value),allexcept(Table[EndofMonth]))

    • Murali777's avatar
      Murali777
      Helper III

      Hi James,

       

      I have tried, but it is not working. if you dont mind pls share the PBIX file.

      Thanks.

  • Hey Murali777 

     

    this article Time patterns – DAX Patterns contains almost everything you need to know to create time/date related calculations.

    It's necessary that you create a dedicated calendar table and then create a measure that cumulates the values from all the data less and equal to the selected date.

     

    Hopefully, this helps to tackle your challenge.

     

    Regards,

    Tom

  • Anonymous's avatar
    Anonymous
    Not applicable

    The table

    the measure ==>

     

    • Murali777's avatar
      Murali777
      Helper III

      Hi James,

       

      It is calculating the total for all the users. if i added or removed some of the user, that time also it is showing the same total sum value. I need total for only selected users.

  • Anonymous's avatar
    Anonymous
    Not applicable

    hi Murali777 

     

    You can use this measure

    MonthwiseTotal = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[End Of Month]))
     

    If this post helps, accept it as a solution.

    • Murali777's avatar
      Murali777
      Helper III

      Hi Esha,

      Please see this example below, i have removed the user C an D from the second table but still it is summing all the users value. I need to sum only the selected user values. Please help me with this example.

       

       

    • Murali777's avatar
      Murali777
      Helper III

      Hi Esha,

       

      Is any input on the below scenario please?

       

      • Murali777's avatar
        Murali777
        Helper III

        Below is the code for the output Esha.. We need to filter based on the User right. it works fine. 

         

        Thank you for your help as well.

         

        MonthlyTotal1 = CALCULATE(SUM(EmployeeTable[Value]),ALLSELECTED(EmployeeTable[User]))