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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

I need a help on a simple query

Hi EveryBody,

I have 2 tables

 

'Promotion' Table

 

Id      IdTransaction   CodePromo          

 

 1           1011           A

 2           1012           A

 3           1013           B

 4           1014           C

 5           1015           A

 6           1016           B

 7           1017           C

 

And 'Group' Table

 

IdPerson     IdTransaction

 

13111         1011

13111         1012

13112         1013

13112         1014

13113         1015

13113         1016

13113         1017

 

I want a formula that add a new column [Idperson] in Promotion table

 Thank's a lot

2 ACCEPTED SOLUTIONS
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may add a calculated column as below:

Column =
LOOKUPVALUE (
    'Group'[IdPerson],
    'Group'[IdTransaction], Promotion[IdTransaction]
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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

Ashish_Mathur
Super User
Super User

Hi,

 

If there will never be repetitions in the idTransactions column of the Group Table, then you can create a relationship from the idTransactions column of the Promotion Table to the idTransactions column of the Group Table.  Then write this calculated column formula in the Promotion Table

 

=RELATED([Group[idPerson])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

If there will never be repetitions in the idTransactions column of the Group Table, then you can create a relationship from the idTransactions column of the Promotion Table to the idTransactions column of the Group Table.  Then write this calculated column formula in the Promotion Table

 

=RELATED([Group[idPerson])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may add a calculated column as below:

Column =
LOOKUPVALUE (
    'Group'[IdPerson],
    'Group'[IdTransaction], Promotion[IdTransaction]
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SivaMani
Resident Rockstar
Resident Rockstar

@Anonymous,

 

Why don't you create a Relationship based on IdTransaction?

 

It will give the same output that what are looking for now.

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.