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
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
Employee
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
Employee
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
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.

Top Solution Authors