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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

how to add multiple columns from multiple table with SELECTCOLUMNS?

So I am trying to add the following columns from the following tables to a new table called "updates":

 

Table: ComputerUpdate

Columns: ci_id, machineid, status, last status change

 

Table: Computer

Column: Operating System

 

Table: Update

Column: title

I was able to use this formula to add in one column:

 

updates = SELECTCOLUMN(ComputerUpdate,"ci_id",[ci_id])

 

I can't figure out how to use this to add more than one though. Any help would be appreciated 🙂

4 REPLIES 4
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

You can try using ADDCOLUMNS or RELATED function

 

https://dax.guide/addcolumns/

 

https://dax.guide/related/

 

Regards,

Harsh Nathani

lbendlin
Super User
Super User

once you added them what are you planning to do next?  Table variables are short lived, they only exist inside the measure they are created. 

 

What prevents you from letting the data model do the work?

Anonymous
Not applicable

Well I'm having some strange issues. Basically I have a measure formula that works but when I slice it, it adds things that aren't supposed to be there, I'm just experimenting to see if I bring everything into one table whether or not it will work.

I was able to come up with this so far:

 

UNION(SELECTCOLUMNS(ComputerUpdate,"ci_id",ComputerUpdate[ci_id]),SELECTCOLUMNS(ComputerUpdate,"machineid",ComputerUpdate[machineid]),SELECTCOLUMNS(Computer,"Operating System",Computer[Operating System]))

 

It works but everything is in one column instead of multiple. I know the UNION function is at fault but I don't know what else to use.

Yeah, UNION is not your friend here.

 

Are the tables related, or are they dangling around?  In the former case you can potentially use RELATED() references, in the latter LOOKUPVALUE()

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.