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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Syndicate_Admin
Administrator
Administrator

How to display a column in another table, according to the value of a column in the initial table.

Hello community, I do not have much knowledge of PBi and I am trying to do a simple thing, but I do not know how to do it, or where I make the mistake.

I have two tables with relation by the column "Document" and I need to create in table 1, a measure or colunma that according to the value of the column "Chivato" of table 1 (possible values 1, 2 and 3), show the value of the column "MORE 2 YEARS", "MORE 4 YEARS" or "MORE 20 DAYS" of table 2, according to the value of the column "Chivato" of table 1, I do not know if I explain myself well, I attach an image.

tablas_foro.png

I don't know if someone comes up with how they could do it, thanks in advance Raul.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Syndicate_Admin ;

You could unpivot in power query,

1.unpivot three columns

vyalanwumsft_0-1665454271731.png

2.group then add index column,

= Table.Group(#"Unpivoted Columns", {"DOCUMENTO"}, {{"a", each Table.AddIndexColumn(_, "Index",1,1),  type table}})

vyalanwumsft_1-1665454316561.png

3.merge "DOCUMENTO", "Index"column

vyalanwumsft_2-1665454342222.png

4.in table1 merge too.

vyalanwumsft_3-1665454369060.png

5.merge two tables.

vyalanwumsft_4-1665454396911.png

6.split column.

vyalanwumsft_5-1665454426658.png


Best Regards,
Community Support Team _ Yalan Wu
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

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @Syndicate_Admin ;

You could unpivot in power query,

1.unpivot three columns

vyalanwumsft_0-1665454271731.png

2.group then add index column,

= Table.Group(#"Unpivoted Columns", {"DOCUMENTO"}, {{"a", each Table.AddIndexColumn(_, "Index",1,1),  type table}})

vyalanwumsft_1-1665454316561.png

3.merge "DOCUMENTO", "Index"column

vyalanwumsft_2-1665454342222.png

4.in table1 merge too.

vyalanwumsft_3-1665454369060.png

5.merge two tables.

vyalanwumsft_4-1665454396911.png

6.split column.

vyalanwumsft_5-1665454426658.png


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

v-yalanwu-msft
Community Support
Community Support

Hi, @Syndicate_Admin ;

Can you share the result what you want to output to let us understand you logic?


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

I think it is not possible, thank you equally

To forgive is that I explain myself very badly, the result of what I want to achieve is this:

fist_0-1665052016623.png

I need to bring from another trabla the value of one column or another, according to the value of the CHIVATO column.

Thank you very much for being interested in my doubts, I am attentive in case I need to give you more information.

Greetings.

Anonymous
Not applicable

Is "DOCUMENTO" a unique key? If so, you can join the tables as part of the import process and choose whatever columns you prefer. If not, you can duplicate DOCUMENTO and CHIVATO columns and create a unique JoinKey column by merging the resulting two DOCUMENTO(1)  and CHIVATO(1) columns in your M query import. Please let me know if this is what you are looking for.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.