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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mementocorgi
Frequent Visitor

Paste Serial Number From Row with Same Order Numbers

I've got a large table of values (added a picture for clarity)

mementocorgi_0-1666815796378.png


The problem I'm having is that while some of the SO's and SI's have the same Order Number, only the SO's have a serial number. What can I use to make a new column which copies the serial numbers from the SO's that have matching ON's to their corresponding SI rows? 

Any help is appreciated!

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@mementocorgi ,

There are different ways to accomplish this, but I believe this should work for you:

SerialNoRevised = 
VAR _Order = [OrderNo]
VAR _SerialNo = CALCULATE( MAX([SerialNo]), FILTER( SN, SN[OrderNo] = _Order && SN[Source] = "SO" ))

RETURN
    _SerialNo

OrderNoSourceSerialNoSerialNoRevised

1 SO 123 123
1 SI   123
2 SI   456
2 SO 456 456

In the future it would help to post sample data as a table, not an image.  This will help in facilitating answers to your posts.

Regards,

View solution in original post

3 REPLIES 3
AUaero
Responsive Resident
Responsive Resident

Try this:

OrderSerialNumber = 
VAR ThisOrderNumber = SerialTest[OrderNumber]

RETURN
MINX(
    FILTER(
        SerialTest,
        SerialTest[OrderNumber] = ThisOrderNumber &&
        SerialTest[RecordSource] = "SO"
    ),
    SerialTest[SerialNumber]
)
rsbin
Super User
Super User

@mementocorgi ,

There are different ways to accomplish this, but I believe this should work for you:

SerialNoRevised = 
VAR _Order = [OrderNo]
VAR _SerialNo = CALCULATE( MAX([SerialNo]), FILTER( SN, SN[OrderNo] = _Order && SN[Source] = "SO" ))

RETURN
    _SerialNo

OrderNoSourceSerialNoSerialNoRevised

1 SO 123 123
1 SI   123
2 SI   456
2 SO 456 456

In the future it would help to post sample data as a table, not an image.  This will help in facilitating answers to your posts.

Regards,

Thank you! I'll do so next time. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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