Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

comparing 1 month

hi

i am looking for dax for comparing past 1 month with current month for my data

 

 

 

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amit

      i tried using ur dax on my data but its not displaying any values.

      could you plz help me.

       

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , hope the problem is number type, else use count in place of sum .

         

        Can you share the error, click on details and provide that

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi amit

      i tried this dax for calculting last year calls but it is not returing the correct count. 

       

       

  • VijayP's avatar
    VijayP
    Community Champion

    Anonymous 

    The Breakup of Formula like this

    First to find the Last month revenue = Calculate(Total Revenue, DateAdd(Datedim[date],-1,Month)
    you can compar the Data using a Table Visual by placing Date, Total Revenue, Last month Revenue (day by day copmparison)
    if you want to see the cumulative then DATESMTD comes into the picture
    Current MTD = Calculate(Total Revenue, Datesmtd(dAtedim[date))
    Last Month MTD = Calcualte(last month revenue,Datesmtd(datedim[date)
    Then you can compared MTD to MTD with an area Chart using Date as Axis to see the comparison

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could use PREVIOUSMONTH() function

    Measure =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        PREVIOUSMONTH ( 'Table'[Date] ),
        ALLEXCEPT ( 'Table', 'Table'[Category] )
    )

     

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