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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
caito103
Helper I
Helper I

Create new table based on Distinct of two columns from other table

Hello,

Im trying to create a new table based on a table with differents columns, but i need to use just two of them:

 

 

This table have name of the seller and the store of each transaction realized, that is why each seller and store is repeated.

But the trick is that im trying to add in this new table just EACH SELLER with his STORE and not repeat it.

 

Also, i created a new table with each store and a code, if i try to make this new table and using each row to replace, for example, each STORE name for jsut the code, how i will be able to do it? I weas thinking use SWITCH DAX formula, but i can find how to extract the data first.

 

 

 

Thank you so much!

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @caito103,

 

Suppose we have two basic tables: Table1 and Table2

1.PNG     2.PNG

 

Then, create a new calculated table using below formula. Also, in this new table, create a calculated column to show the code for each store.

New Table1 = SUMMARIZE(Table1,Table1[STORE],Table1[SELLER])

STORE CODE = LOOKUPVALUE(Table2[CODE],Table2[STORE],'New Table1'[STORE])

3.PNG

 

Best regards,
Yuliana Gu

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

View solution in original post

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @caito103,

 

Suppose we have two basic tables: Table1 and Table2

1.PNG     2.PNG

 

Then, create a new calculated table using below formula. Also, in this new table, create a calculated column to show the code for each store.

New Table1 = SUMMARIZE(Table1,Table1[STORE],Table1[SELLER])

STORE CODE = LOOKUPVALUE(Table2[CODE],Table2[STORE],'New Table1'[STORE])

3.PNG

 

Best regards,
Yuliana Gu

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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