Forum Discussion

Uzi2019's avatar
Uzi2019
Community Champion
5 years ago
Solved

Incorrect Previous month total

Hi Experts,   I want to show percentage of previous month. After creating formula  Previous Cost = var prev= CALCULATE(SUM(Channel[Cost]),DATEADD(Channel[date],-1,MONTH)) var curr= CALCULATE(S...
  • v-robertq-msft's avatar
    v-robertq-msft
    5 years ago

    Hi, Uzi2019 

    According to your picture and description, I guess that you want to make the total row of [prev] display the correct total value, you can create a new measure [prev_new]:

    prev_new =
    
    var _new=SUMMARIZE('Table','Table'[date],"_value",[prev])
    
    return IF(HASONEVALUE('Table'[date]),[prev],SUMX(_new,[_value]))

    You should replace the ‘Table’ with your table name, and place this measure into the table chart.

    And you can get what you want.

     

    If this result is not what you want, you can post some sample data(without sensitive data) so that we can help you in advance.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

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