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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
jppuam
Helper V
Helper V

showing field crossing another table

Hello,

i have 2 tables and i'm trying to cross table A with table B, (with many-to-one) in line to mantain the data that i've on table A, and map with the data that i've on table B.

I want to agregate the data like this :

- dep A, should be Master Dep A

- dep B, should be Master Dep B

- and all the others departments should be aggregated as Others,

but i'm not reach making this, can anyone see whats the problem ?

test1.png

thanks,

JP

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@jppuam 

is this what you want?

cost = LOOKUPVALUE('table A'[Cost],'table A'[Department ID],'table B'[Department ID],'table A'[Level ID],'table B'[Level ID])

Master Department = SWITCH('table B'[Department ID],"dep A","Master dep A","dep B","Master dep B","Others")

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Using the Query Editor, you can join Table A into Table B based on the 2 common columns to bring over Cost into Table B.  In Table B, you can write this DAX formula

=if('table B'[Department ID]="Dep A","Master Dep A",if('table B'[Department ID]="Dep B","Master Dep B","Others"))

Hope this helps.


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

@jppuam 

is this what you want?

cost = LOOKUPVALUE('table A'[Cost],'table A'[Department ID],'table B'[Department ID],'table A'[Level ID],'table B'[Level ID])

Master Department = SWITCH('table B'[Department ID],"dep A","Master dep A","dep B","Master dep B","Others")

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Kudoed Authors