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
JamesBockett
Helper I
Helper I

Calculated columns based on columns in other tales

Hi everyone

 

I have 4 data tables. (T1, T2, T3 and T4).

T1 and T2 connect using column [Occ. ID]

T2 and T3 connect using column [Ves. ID] - T3 does not have column [Occ. ID]

T3 and T4 connect using column [Con. ID] - T4 does not have column [Occ. ID] or [Ves. ID]

 

Each have calculated columns in. I would like to know if it is possible to have a fifth table that I add calculated columns to that looks across T1, T2, T3, T4 so that all my calculated columns are in one table with nothing (or very little) else in T5?

 

Many thanks

James

5 REPLIES 5
v-rzhou-msft
Community Support
Community Support

Hi @JamesBockett 

Here I don't suggest you to create new table by dax directly. If your relationship has many side, your result will return to summarize.

I suggest you to merge your Four tables by Merge function and then create calculated column in your new table T5.

EX:

Merge T1 and T2 as a new table by [Occ. ID] and then Expand all columns you need from T2. We call New table as T5.

Then Merge T5 and T3 by  [Ves. ID] ...

You will get a new basic table and you can use this table to create calculated columns.

For reference:

Combine queries

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-rzhou-msft 

 

I've done as you said and have succesfully made one table. It is 71 columns wide though. This probably isn't very good? What are your thoughts?

 

Many thanks

James

amitchandak
Super User
Super User

@JamesBockett , The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.


 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Hi @amitchandak 

 

Here is an example of what I have and would like to achieve.

JamesBockett_3-1635437880410.png

I hope this helps?

 

Thanks

James

Hi @JamesBockett 

You can try summarize, addcolumn function to create a large table by Dax. Then create new calculated columns based on your logic.

For reference:

Summarize

Addcolumns

As I replied before, if your relationship has many side, your result will return to summarize (DAX). If you want to expand your table, I still suggest you to merge your Four tables by Merge function and then create calculated column in your new table T5.

You have tried Merge, and you got a new table with 71 columns. Don't keep the useless or duplicate columns. You can optmize your table by remove columns you don't need. 

 

Best Regards,
Rico Zhou

 

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.