cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DataShos18
Regular Visitor

Inheriting and populate data based on a column

Hello!

 

Im having difficulties with inheriting "Startdate" based on "Orderid".

Powerbi Analysis question.png

 

For my issue - 

Let's take a random ORDERID as in the screenshot (GPA.3315).

The first purchase of the user has its start date and month and called "Purchase" (Yellow square in the screenshot).

The next purchase for the same ORDERID will be "Renewal" as in the screenshot (Red square in the screenshot).

I'm trying to inherit the startdate and startmonth from "Purchase" to all related "Renewal".

This way I can map the different renewals to the original start date of the user.

 

Any quick solution I can use?

 

Thanks in advance,

Bar

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @DataShos18 ,

 

You could use Fill feature.

https://docs.microsoft.com/en-us/power-query/fill-values-column 

Step1:

Sort sort the table by [Orderid]

Step2:

Selecte [Start date] and use fill down feature.

1.PNG

2.PNG

 

Best Regards,

Jay

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

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @DataShos18 ,

 

You could use Fill feature.

https://docs.microsoft.com/en-us/power-query/fill-values-column 

Step1:

Sort sort the table by [Orderid]

Step2:

Selecte [Start date] and use fill down feature.

1.PNG

2.PNG

 

Best Regards,

Jay

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

View solution in original post

DataShos18
Regular Visitor

Anyhelp?

@amitchandak 

amitchandak
Super User IV
Super User IV

@DataShos18 , Not very clear.

 

Try a new column like

new column =
var _rnk = rankx(filter(Table, [user]=earlier([user]) && [startmonth]=earlier([startmonth])),[start date])
return
if(_rnk =1, "Purchase", "Renewal")

 

if needed remove startmonth filter



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Thanks for the fast replay!

Sorry for not being clean. Im trying to copy the startdate and startmonth from "Purchase" row to the renewals of the same "OrderID".

this is what I'm trying to achieve 

DataShos18_3-1610025966680.png

 

 

I tried your solution in a custom column but I'm getting an error, what did I do wrong?

DataShos18_1-1610025505651.png

 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors