Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Percent Change between values

Hi everybody!,

 

I'm having a problem trying to calculate this % change, what I need is quite simple i want to see the variation from 1/0 (299,87/82,97), 2/1 (336,56/299,87), 3/2 (318,29/336,56),etc.

There is anyway to do it?

 

Pic 2.PNG 

 

Thanks

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume you have data as below

Capture7.JPG

Then create a measure

Measure =
VAR pre =
    CALCULATE (
        SUM ( 'Table'[value] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[group] ),
            'Table'[index]
                = MAX ( 'Table'[index] ) - 1
        )
    )
RETURN
    IF ( pre = BLANK (), BLANK (), SUM ( 'Table'[value] ) / pre )

Capture6.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume you have data as below

Capture7.JPG

Then create a measure

Measure =
VAR pre =
    CALCULATE (
        SUM ( 'Table'[value] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[group] ),
            'Table'[index]
                = MAX ( 'Table'[index] ) - 1
        )
    )
RETURN
    IF ( pre = BLANK (), BLANK (), SUM ( 'Table'[value] ) / pre )

Capture6.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,

You will need to edit query in Power Query and go to Transform Tab, the Transpose button.  That will give you the picture below. Back in Power BI add a column with the dax below to get the values you are after.

 

Please let me know if you have any questions.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

 

 

percent change = 
var _column1 ='Table'[Column1]
var _presvalue = 'Table'[Column2]
var _previndex = Calculate(MAX('Table'[Column1]), FILTER(All('Table'),'Table'[Column1]<_column1))
var _prevvalue = Calculate(MAX('Table'[Column2]),FILTER(All('Table'),'Table'[Column1]=_previndex))
return if ('Table'[Column1] > 0,Divide(_presvalue,_prevvalue),0)

percent diff.PNG

 

 

 

percent diff1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.