Reply
Frequent Visitor
Posts: 8
Registered: ‎12-11-2018

Use previous months actuals as current months actuals?

Hi,

 

I have a dataset looking like this:

 

YearMonth | MeasurementType | Measurment

201810       |  Hum                      |    0.3

201810       |  Tmp                       |    20.1

201811       |  Hum                      |     0.9

201811       |  Tmp                       |     22.3

In my Power Query i would like to copy previous month actuals to use as current month actuals - reason being I don't get the new actuals before end of month.. So I'd like output to be:

YearMonth | MeasurementType | Measurment

201810       |  Hum                      |    0.3

201810       |  Tmp                       |    20.1

201811       |  Hum                      |     0.9

201811       |  Tmp                       |     22.3

201812       |  Hum                      |     0.9

201812       |  Tmp                       |     22.3

 

Then when month is over - when the actuals are actually there, the "interpolated" numbers should be replaced..

 

Can anyone think of an elegant way to do this?

 

Best, Jon

Community Support Team
Posts: 1,613
Registered: ‎07-30-2018

Re: Use previous months actuals as current months actuals?

hi, @JonKarlsson

You may try to use Append Function Power Query.

here are some tutorial for you to refer to:

https://www.youtube.com/watch?v=jcHqWNAGV1w

http://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Frequent Visitor
Posts: 8
Registered: ‎12-11-2018

Re: Use previous months actuals as current months actuals?

I have data for all months except the current.

So I need to

 

1. Extract the previous month

2. Add 1 to the month

3. Append this to original table

 

I just can't seem to make in a nice way with M. Any suggestions?

 

Jon

Community Support Team
Posts: 1,613
Registered: ‎07-30-2018

Re: Use previous months actuals as current months actuals?

[ Edited ]

hi, @JonKarlsson

It should be achieved, Could you share a sample pbix file or some data sample and expected output.  Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

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