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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
kash123
Frequent Visitor

Complex formula in Power BI

HI 

 

I want to implement a spot rate to forward rate formula in PowerBi: Is this possible? 

 

I already have the spot rates in a column loaded from an SQL data base, how would I create a new column for the forward rates?

 

The formula for spot rate to forward rate conversion is 

 

[(1 + current spot rate)^t / (1+ prev spot rate)^t-1]-1

 

The trouble I am having is referencing the previous spot rates with the t before. 

 

Thanks 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kash123 ,

 

 [(1 + current spot rate)^t / (1+ prev spot rate)^t-1]-1   What does "t" in this formlua stand for? 

 

If you do not know how to get the previous value , since the Time is continuously, you could use 

_previousRate= CALCULATE(MAX('Table'[Spot Rate]),FILTER('Table',[Spot Rate]=EARLIER('Table'[Spot Rate])-1))

Like:

Forward Rate = 
var _previousRate= CALCULATE(MAX('Table'[Spot Rate]),FILTER('Table',[Spot Rate]=EARLIER('Table'[Spot Rate])-1))
return  POWER( 1+ [Spot Rate], [Time] )/ POWER( 1+_previousRate, [Time]-1)  -1  

Eyelyn9_0-1641197957354.png

 

Best Regards,
Eyelyn Qin
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

7 REPLIES 7
Anonymous
Not applicable

Hi @kash123 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file afterremoving sensitive data.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @kash123 ,

 

 [(1 + current spot rate)^t / (1+ prev spot rate)^t-1]-1   What does "t" in this formlua stand for? 

 

If you do not know how to get the previous value , since the Time is continuously, you could use 

_previousRate= CALCULATE(MAX('Table'[Spot Rate]),FILTER('Table',[Spot Rate]=EARLIER('Table'[Spot Rate])-1))

Like:

Forward Rate = 
var _previousRate= CALCULATE(MAX('Table'[Spot Rate]),FILTER('Table',[Spot Rate]=EARLIER('Table'[Spot Rate])-1))
return  POWER( 1+ [Spot Rate], [Time] )/ POWER( 1+_previousRate, [Time]-1)  -1  

Eyelyn9_0-1641197957354.png

 

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

amitchandak
Super User
Super User

@kash123 , Assume you have two columns

date and spot rate and date are not continuous

 

Then previous rate in a new columns

 

Last rate =

var _max = maxx(filter(Table, [Date] < earlier([date]) , [Date])

return

maxx(filter(Table, [Date] =_max) , [Spot Rate])

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

Hi Amit 

 

Thank you for your response! How do I implement the formula you have given me, is each line in a new column/measure

@kash123 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Hi

 

This is a sample data

 

TimeSpot RateForward Rate
10.5 

2

0.6 
30.7 
40.8 
50.9 
61.0 
71.1 
81.2 
91.3 

 

I want to implement the formula above into the column forward rates.

 

Thanks

@kash123 , I am not sure about t, so I used time. Please find the attached file after signature

 

new column

 

Previous Spot Rate = var _max = maxx(filter('Rate', [Time] <EARLIER('Rate'[Time]) ),[Time]) return maxx(FILTER('Rate', 'Rate'[Time] =_max),[Spot Rate])

forward rate = var _max = maxx(filter('Rate', [Time] <EARLIER('Rate'[Time]) ),[Time]) 
return  divide( POWER((1+'Rate'[Spot Rate]),'Rate'[Time]) , POWER((1+'Rate'[Previous Spot Rate]),_max )) -1
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
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.