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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
rkxiii
Frequent Visitor

How to get the Percent Difference from previous data

rkxiii_0-1724297815486.png

I would like to know what formula to use to get the percentage difference from the previous data that I have (seen from the image). Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @rkxiii 

 

You can try the following methods.

Measure:

Diff = 
Var _Prevdate=CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])))
Var _PrevYield=CALCULATE([Yield],FILTER(ALL('Table'),[Date]=_Prevdate))
RETURN
IF(_PrevYield=BLANK(),BLANK(),[Yield]-_PrevYield)

vzhangtinmsft_0-1724395636577.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

6 REPLIES 6
Anonymous
Not applicable

Hi, @rkxiii 

 

You can try the following methods.

Measure:

Diff = 
Var _Prevdate=CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])))
Var _PrevYield=CALCULATE([Yield],FILTER(ALL('Table'),[Date]=_Prevdate))
RETURN
IF(_PrevYield=BLANK(),BLANK(),[Yield]-_PrevYield)

vzhangtinmsft_0-1724395636577.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

 

Hi,
Also could you please include the Model Name for this solution? Thank you very much for your help!

rkxiii
Frequent Visitor

Its okay now. I just Filter All Except the Model Name. Thank you!

Hi, Thank you very much for your help. This is the solution I am looking for. Again, Thank you very much!

 

anmolmalviya05
Super User
Super User

Hi @rkxiii, Hope you are doing good!

Please try the below DAX to create a new calculated column as per your requirement:

Difference =
VAR PreviousPercent =
CALCULATE(
MAX(TableName[Percent]),
FILTER(
TableName,
TableName[IndexColumn] = EARLIER(TableName[IndexColumn]) - 1
)
)
RETURN
IF(
ISBLANK(PreviousPercent),
0,
TableName[Percent] - PreviousPercent
)

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

Hi, Thank you for your response. 

I used the PowerBi Visual "Table" for the table used in the image, is the solution still applicable?
Is it also possible just to add "New Measure" for the percentage? Thank you. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors