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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calculating the difference and % difference between 2 columns

Hello, 

 

I am looking to calculate the numerical difference (in one column) and % difference (another column) between the last two dates for each row: 31st July and 17th August. The values in this table are from one measure, filtered by date and Financial Partner.

 

soochoilondon_0-1660830011024.png

Thank you. 

 

2 REPLIES 2
Anonymous
Not applicable

Hello Amit, 

I have done the measures, many thanks. 

 

However, although the rank is correct - it is only calculating for previous day. How do I calculate it so that it is always max date, and then last day of the previous month i.e 31st July?

 

soochoilondon_0-1661085120441.png

 

amitchandak
Super User
Super User

@Anonymous , Create a new table with distinct dates from this table

 

dates = distinct(Fin[date])

 

Then add new rank column

rank = rankx(dates, [Date],,asc,dense)

 

Join this with date of you date table

 

and create measure like

This Date= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Dates'),'Dates'[Rank]=max('Dates'[Rank])))
Last Date= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Dates'),'Dates'[Rank]=max('Dates'[Rank])-1))

 

Now you can have diff = [This Date] - [Last Date]

 

diff % = divide([This Date] - [Last Date], [last Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors