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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
mtrevisiol
Helper V
Helper V

Combine rows according to a column

Hi everyone,

I've got a table which contains the list of customers of a company:

 

mtrevisiol_1-1662034496446.png

 

Each customer has a code and a name, and some of them change their name over time.

My intent is to create a new table that contains only the most recent names of each customer, so the ideal result would be:

 

mtrevisiol_2-1662034536517.png

 

because client 001 has become 003 and then 006, and client 002 has became 005.

 

How can I do it? This is the pbix file: https://www.dropbox.com/s/z1s9hgw4p5qtrsl/Customers.pbix?dl=0

 

Thanks for the help

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a new table like

Filtered Customers = CALCULATETABLE(
	Customers,
	EXCEPT( VALUES( Customers[Code]), VALUES( Customers[OldCode]))
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Create a new table like

Filtered Customers = CALCULATETABLE(
	Customers,
	EXCEPT( VALUES( Customers[Code]), VALUES( Customers[OldCode]))
)

Many thanks, it perfectly works!

I found that an alternative way consists of a "Right anti" merge between Customers.OldCode on power query

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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