Hi all!
I came up against a problem where I have to get a value in Power Query for an equal row in the last non blank period.
For example:
[table="width: 500, class: grid"]
[tr]
[td]Product[/td]
[td]Class[/td]
[td]Region[/td]
[td]Week[/td]
[td]Price[/td]
[td]Sales[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]40[/td]
[td]254[/td]
[td]777[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]43[/td]
[td]256[/td]
[td]445[/td]
[/tr]
[tr]
[td]C[/td]
[td]Ships[/td]
[td]South America[/td]
[td]6[/td]
[td]356[/td]
[td]577[/td]
[/tr]
[tr]
[td]D[/td]
[td]Ships[/td]
[td]South America[/td]
[td]3[/td]
[td]345[/td]
[td]57[/td]
[/tr]
[tr]
[td]E[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]4563[/td]
[td]5757[/td]
[/tr]
[tr]
[td]F[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]665[/td]
[td]7777[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]45[/td]
[td]234[/td]
[td]654[/td]
[/tr]
[/table]
So what I have to do here is for each combination of Product + Class + Region find a sales amount for the last non blank week (so I have to make sure that week is exist and it has a sales).
Has anyone faced with something like this?
Expected result:
[table="width: 600, class: grid"]
[tr]
[td]Product[/td]
[td]Class[/td]
[td]Region[/td]
[td]Week[/td]
[td]Price[/td]
[td]Sales[/td]
[td]Sales last non blank[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]40[/td]
[td]254[/td]
[td]777[/td]
[td][/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]43[/td]
[td]256[/td]
[td]445[/td]
[td]777[/td]
[/tr]
[tr]
[td]C[/td]
[td]Ships[/td]
[td]South America[/td]
[td]6[/td]
[td]356[/td]
[td]577[/td]
[td][/td]
[/tr]
[tr]
[td]D[/td]
[td]Ships[/td]
[td]South America[/td]
[td]3[/td]
[td]345[/td]
[td]57[/td]
[td][/td]
[/tr]
[tr]
[td]E[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]4563[/td]
[td]5757[/td]
[td][/td]
[/tr]
[tr]
[td]F[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]665[/td]
[td]7777[/td]
[td][/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]45[/td]
[td]234[/td]
[td]654[/td]
[td]445[/td]
[/tr]
[/table]
I came up against a problem where I have to get a value in Power Query for an equal row in the last non blank period.
For example:
[table="width: 500, class: grid"]
[tr]
[td]Product[/td]
[td]Class[/td]
[td]Region[/td]
[td]Week[/td]
[td]Price[/td]
[td]Sales[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]40[/td]
[td]254[/td]
[td]777[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]43[/td]
[td]256[/td]
[td]445[/td]
[/tr]
[tr]
[td]C[/td]
[td]Ships[/td]
[td]South America[/td]
[td]6[/td]
[td]356[/td]
[td]577[/td]
[/tr]
[tr]
[td]D[/td]
[td]Ships[/td]
[td]South America[/td]
[td]3[/td]
[td]345[/td]
[td]57[/td]
[/tr]
[tr]
[td]E[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]4563[/td]
[td]5757[/td]
[/tr]
[tr]
[td]F[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]665[/td]
[td]7777[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]45[/td]
[td]234[/td]
[td]654[/td]
[/tr]
[/table]
So what I have to do here is for each combination of Product + Class + Region find a sales amount for the last non blank week (so I have to make sure that week is exist and it has a sales).
Has anyone faced with something like this?
Expected result:
[table="width: 600, class: grid"]
[tr]
[td]Product[/td]
[td]Class[/td]
[td]Region[/td]
[td]Week[/td]
[td]Price[/td]
[td]Sales[/td]
[td]Sales last non blank[/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]40[/td]
[td]254[/td]
[td]777[/td]
[td][/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]43[/td]
[td]256[/td]
[td]445[/td]
[td]777[/td]
[/tr]
[tr]
[td]C[/td]
[td]Ships[/td]
[td]South America[/td]
[td]6[/td]
[td]356[/td]
[td]577[/td]
[td][/td]
[/tr]
[tr]
[td]D[/td]
[td]Ships[/td]
[td]South America[/td]
[td]3[/td]
[td]345[/td]
[td]57[/td]
[td][/td]
[/tr]
[tr]
[td]E[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]4563[/td]
[td]5757[/td]
[td][/td]
[/tr]
[tr]
[td]F[/td]
[td]Cars[/td]
[td]North America[/td]
[td]4[/td]
[td]665[/td]
[td]7777[/td]
[td][/td]
[/tr]
[tr]
[td]A[/td]
[td]Bikes[/td]
[td]Africa[/td]
[td]45[/td]
[td]234[/td]
[td]654[/td]
[td]445[/td]
[/tr]
[/table]