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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RobinNandal
Frequent Visitor

Calculating Commodity price index

Hi,

 

I have 10 year data on couple of commodities and I am trying to create index for each commodity using 1/1/2009 price as base = 100 and then calculating subesquent month index as (100*Current Price/Base year Price).

                       where base year price refers to 1/1/2009 price

 

.pic.PNG

 

I tried to create a measure first using the LOOKUPVALUE to return 1/1/2009 price and use it in formula - did not work

Then, I tried to use the % change column

Thermal coal index = IF(Commodities[Month]>1/1/2009,EARLIER(Commodities[ThermalCoal.Change])*(1+Commodities[ThermalCoal.Change]) - but Earlier function doesn't work

 

Please advice

 

2 REPLIES 2
Anonymous
Not applicable

Did you have any luck?? How you solved it.

 

Im trying to calculate a product price index as well. In my case a Avg. Rolling 12 month measure versus the Avg. Rolling 12 Month price 2 years ago.

 

I having big problems with setting a dinamic denominator for this formula. it has to consider the actual Avg.12RM let say Dec 2018, and compare it versus the Avg.12RM price of January 2016. 

 

So the formula would be ("like") = (100) * ( Avg.R12M Dec 2018 price  / AvR12M January 2016*), but at the same time being dynamic as next month 2019" it would move the denominator 1 year to become Avg.R12M January 2017.

 

Any help or suggestions?

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @RobinNandal,

 

Firstly, I'm afraid that you use EARLIER function incorrectly.

 

You could have a reference of this blogabout how to use it.

 

In addition, if you want to calculate the price of 2009/1/1, you could use the formula like below.

 

price for 2009-1-1 =
CALCULATE (
    SUM ( 'table'[price] ),
    FILTER ( ALL ( 'table' ), 'table'[date] = "2009/1/1" )
)

If you still need help, please share some data sample which could reproduce your scenario and your desired output so that we can help further on it.

 

Best Regards,

Cherry

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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