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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anik
Helper I
Helper I

add a new column in a table from database

Hello expert users, we all know that not selecting unnecessary columns is a good way to optimize BI performance. But If I need to select 2/3 columns from database and want to join with a table, how to do that?  For example, sales table contains "City key" but I didn't select it. Now I want to select the City key column and join with the sales table. 

1 ACCEPTED SOLUTION
3 REPLIES 3
Anik
Helper I
Helper I

 

 Capture.PNG

Hi @Greg_Deckler , this is the image of a data model I am working on. The [Dimension City] table contains a column "City key". In order to create a relationship between [Fact sale]  and  [Dimension City], I need to import the column "City key" from original SQL [Fact Sale]. Actually, I didn't select the "City key" column at first. I thought I don't need it. But now I am going need that. How can I bring back the City key column from SQL database in the [Fact Sale column]? I hope I described my problem clearly. I looked for several solutions but nothing came up to my screen.     

Greg_Deckler
Super User
Super User

@Anik Go back to your query and add the City key? Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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