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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Adrian_rev
New Member

Create a column when different rows have the same value

Hello everyone,

 

I have a table with invoices and information about it. For some of them I have a column which states the family_ID of it. Now I need that for every invoice with the same number, if one of them has the family_ID all the invoices with the same number have it too.

INVOICE         FAMILY_ID

2400004561   245641

2400004561

2400004561

These would be the twoo columns, so if I have that for the invoice 2400004561 one of the rows has the family_ID of 245641 I want that for every 2400004561 invoice to have the family_ID 245641.

Thanks in advance,

Adrian

2 ACCEPTED SOLUTIONS
BIswajit_Das
Impactful Individual
Impactful Individual

Hello @Adrian_rev 
You can create a calculated column with the below DAX;

RESULT =
CALCULATE(
    MAX('table_name'[FAMILY_ID]),
    ALLEXCEPT('table_name','table_name'[INVOICE])
)
pbic.png
Please Let me know if this isn't meet your requirement
Thanks & Regards...

View solution in original post

pankajnamekar25
Super User
Super User

Hello @Adrian_rev ,

 

try this

New_Family_ID =

CALCULATE (

    MAX (YourTable[FAMILY_ID]),

    ALLEXCEPT (YourTable, YourTable[INVOICE])

)

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

4 REPLIES 4
pankajnamekar25
Super User
Super User

Hello @Adrian_rev ,

 

try this

New_Family_ID =

CALCULATE (

    MAX (YourTable[FAMILY_ID]),

    ALLEXCEPT (YourTable, YourTable[INVOICE])

)

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

BIswajit_Das
Impactful Individual
Impactful Individual

Hello @Adrian_rev 
You can create a calculated column with the below DAX;

RESULT =
CALCULATE(
    MAX('table_name'[FAMILY_ID]),
    ALLEXCEPT('table_name','table_name'[INVOICE])
)
pbic.png
Please Let me know if this isn't meet your requirement
Thanks & Regards...

Thanks in advance,

 

The problem is that it tells me that there is not a unique value for Family_ID. I might have ten invoices with the same number and two of them have the same family_ID but not the rest. And I would like to have all 10 of them with the same Family_ID.

Best regards,

Adrian

Hello @Adrian_rev 
If you've share some demo data with required result column it would be easy to understand your requirement.
Thanks & Regards ...

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors