Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I'm new to PowerBI - I'm finding it useful but I can still do things in Excel much faster so there's a long way to go yet!
I have a table with the following columns:
Date - An end of month date - 30 June 2019 to 30 June 2002
Name: Name of the institution - ~150 institutions
Loan amount: Showing the amount of the loan - $
I would like to create a new column in PowerQuery that shows the difference in loan amount from one year ago. The solutions on this forum talk about creating an index key and then writing a formula to return the current row -1. That will not work for me because I would need the index to work for both my Date and Name columns.
Does anybody know how to do this?
Thanks!!
Solved! Go to Solution.
Hi @Anonymous ,
We can create a calculated column to work on it instead creating custom column in power query.
Difference =
VAR lastyear =
EDATE ( 'Table'[date], -12 )
VAR na = 'Table'[Name]
VAR lastyearloan =
CALCULATE (
SUM ( 'Table'[Loan amount] ),
FILTER ( 'Table', 'Table'[date] = lastyear && 'Table'[Name] = na )
)
RETURN
IF ( ISBLANK ( lastyearloan ), BLANK (), 'Table'[Loan amount] - lastyearloan )
BTW, pbix as attached.
Hi @Anonymous ,
We can create a calculated column to work on it instead creating custom column in power query.
Difference =
VAR lastyear =
EDATE ( 'Table'[date], -12 )
VAR na = 'Table'[Name]
VAR lastyearloan =
CALCULATE (
SUM ( 'Table'[Loan amount] ),
FILTER ( 'Table', 'Table'[date] = lastyear && 'Table'[Name] = na )
)
RETURN
IF ( ISBLANK ( lastyearloan ), BLANK (), 'Table'[Loan amount] - lastyearloan )
BTW, pbix as attached.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.