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
vjnvinod
Impactful Individual
Impactful Individual

integration of Two tables into one with condition

hi,

 

I have 2 tables, one is dataset and the other one is Unique Account and segment.

 

common coloumns in both table is

Account ,segment(AccountSegment in Datasetup table)

what i would like to achieve is, from my unique account and segment table would like to copy unique account name and segment and replace Account and Accountsegment in Dataset table with that values.

 

Datasetuptable.PNGunique account and segment.PNG

 

how do i achive this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vjnvinod,

 

If I understood correctly, you are trying to get Account and Segment data from Unique Account and segement table into your Datasetup Table.

Try merging these tables using the merge feature. Open "Edit Queries" and merge the tables based on the common columns.

merge.PNG

 

 

You could also drag-and-drop relationships between these tables without merging them in the relationships view or through "Manage Relationships" in the Home tab. 

relations.PNG

 

 

 

 

 

 

 

Br,

 

T

View solution in original post

6 REPLIES 6
v-yulgu-msft
Employee
Employee

Hi @vjnvinod,

 

If there existing a relationship between two tables, you can add calculated columns in datasetup table like this:

unique account name =
RELATED ( 'Unique Account and segment'[Unique Account Name] )

If there is no relationship, you create calculated column in dataset table via LOOKUPVALUE function.

unique account name =
LOOKUPVALUE (
    'Unique Account and segment'[Unique Account Name],
    'Unique Account and segment'[Account], 'Datasetup'[Account]
)

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.

errorlookup.PNG

 

@v-yulgu-msft

 

 

I am getting some error, please see the screenshot

Hi @vjnvinod,

 

Please check in Unique Account and segment table, is [unique account name] matched with [Account]  uniquely? If one single Account has multiple types od Unique Account Name, above error would be prompted.

1.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.
Anonymous
Not applicable

Hi @vjnvinod,

 

If I understood correctly, you are trying to get Account and Segment data from Unique Account and segement table into your Datasetup Table.

Try merging these tables using the merge feature. Open "Edit Queries" and merge the tables based on the common columns.

merge.PNG

 

 

You could also drag-and-drop relationships between these tables without merging them in the relationships view or through "Manage Relationships" in the Home tab. 

relations.PNG

 

 

 

 

 

 

 

Br,

 

T

vjnvinod
Impactful Individual
Impactful Individual

@Anonymous

 

I did tried doing that, but it doesn't help in my case, as i am getting NA's as well. if the unique account name is NA for that particular account, i want to retain Account name as it is (instead NA)

Anonymous
Not applicable

Hi @vjnvinod,

 

Hmm.. What I would do is use "Edit Queries", merge the tables and then create another column with an if clause to get the account name if the merge returns NA.

 

Br,

 

T

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.