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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
YerlaSDU
Helper I
Helper I

Compare 2 columns and get same items with total

Hi Folks,

 

I have a 2 columns from 2 different tables and need to get same items from both and sum of them

As filter, I need to add conditions, where code are same, but CodeName is little different

YerlaSDU_0-1666943267846.png

 

How can I realize it?

 

4 REPLIES 4
chilichill
New Member

Hi,
are the first 4 letters unique for each Code Name and identical in both tables? And what does the connection between the tables look like?

@chilichill 

 

Code  4 letters is same for both, but codename may be different for the same Code. Connection is Many to One

Maybe try something like:

chilichill_0-1666946884726.png

Measure = 
VAR CodeTab1 = LEFT(MAX(Table1[Code Name]), 4)
VAR CodeTab2 = LEFT(MAX(Table2[Code Name]), 4)
RETURN
if(CodeTab1 = CodeTab2, SUM(Table1[Value]) + SUM(Table2[Value]), BLANK())

it always shows blank

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors