Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Linear Interpolation between dates and another dimension

Hi Everyone,

 

 

Im trying to replicate this report in Power BI 

 

http://ir.eia.gov/ngs/ngs.html

 

I found the raw data for free via Odata which is great as I can auto refresh

 

Data Source: http://eiaconnector.oilstat.com/odata/naturalgas

Table: Storage - Weekly Working Gas in Underground Storage

 

As I started creating the measures, I noticed they dont match with the report on the website ( 5 year average, yearly change, etc) 

 

As I started looking at the report methodology, I noticed they are interpolaring the weekly values into daily to calculate those yearly and 5 year averages.

 

http://ir.eia.gov/ngs/methodology.html

 

I started investigating if this is something I can do in Power Bi and found this amazing post

 

Kudos to Greg_Deckler

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Linear-Interpolation/m-p/330712

 

However when I try to apply it here, Im stuck because this report has different dimensions. I have weekly volumes by region that i need to calculate daiyly

 

Can I calculate the dayly values by interpolating by region if I cant relate the table? 

 

Any help would be highly appreciated it

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous - Glad you liked that post. So, it seems that you are running into an issue because you need this to be dynamic (measure) and not calculated columns?

     

    If you could maybe post some sample data and expected output that would be very helpful. 

     

    Also, I did another similar post here: https://community.powerbi.com/t5/Quick-Measures-Gallery/Mind-the-Gap-Irregular-Time-Series/m-p/991790#M436

     

    I do not see why this kind of thing couldn't be done "on the fly", essentially constructing the interpolation table as a table variable in DAX but I'd have to understand exactly what your expectations are.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, 

       

      Thank you for your quick response, this is the sample data

      https://we.tl/t-Gyr0Z51QH3

      and this is the pibx file

      https://we.tl/t-kU8RumZUSh

       

       

      I guess my where I am confused is would I have to create a date table with each day of year repeating itself each occurence of the dimension to showcase daiyly volumes per region? 

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Actually might be best to use the pbix file as the data from the sample file is pivoted. Greg_Deckler