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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mikro87
Helper II
Helper II

How to add a new colunm to a table in the data model

Hello everybody, 

I have a dashboard in which I want to add a column that was added in the database after I added the table in the dashboard. 

This is how the table is included in Power-Query:

mikro87_0-1644571538777.png

Can someone tell me how to integrate the new field?

Thanks

mikro

1 ACCEPTED SOLUTION

@mikro87  You may need to click the 'refresh preview' button to see the new columns in Power Query.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

9 REPLIES 9
AllisonKennedy
Super User
Super User

@mikro87  What are your other steps in Power Query? Do you have a Removed Other Columns step or something similar? Click the settings cog on that step and select the new column. 

 

If that doesn't work, please click Advanced Editor and paste that entire code into here so we can assist.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

hi @AllisonKennedy

in the Advanced Editor I have this script:

mikro87_0-1644572274857.png

The is no typical SQL script. How can I add something here?

I'm using the incremental load here. Also, I "just" selected the table as I added it to the dashboard without giving a query.

let
Quelle = Sql.Databases("BISERVER"),
#"CT dwh 03 Intelligence" = Quelle{[Name="CT dwh 03 Intelligence"]}[Data],
sales_vFactOrderInvoice = #"CT dwh 03 Intelligence"{[Schema="sales",Item="vFactOrderInvoice"]}[Data],
#"Gefilterte Zeilen" = Table.SelectRows(sales_vFactOrderInvoice, each [TransactionDateDimCalendarId] >= StartDate),
#"Gefilterte Zeilen1" = Table.SelectRows(#"Gefilterte Zeilen", each [LastUpdate] > RangeStart and [LastUpdate] <= RangeEnd),
#"Gefilterte Zeilen2" = Table.SelectRows(#"Gefilterte Zeilen1", each true)
in
#"Gefilterte Zeilen2"

for other talbes it looks like this: 

let
Quelle = Sql.Database("BISERVER", "CT dwh 03 Intelligence", [Query="SELECT [DimUserId]#(lf) ,[user]#(lf) ,[CreationDate]#(lf) FROM [CT dwh 03 Intelligence].[sales].[tDimUser] with (nolock)"])
in
Quelle

@mikro87  The first one you posted (vFactOrderInvoice) should return the new columns if they are added. 

 

The second one you posted ( let
Quelle = Sql.Database("BISERVER", "CT dwh 03 Intelligence", [Query="SELECT [DimUserId]#(lf) ,[user]#(lf) ,[CreationDate]#(lf) FROM [CT dwh 03 Intelligence].[sales].[tDimUser] with (nolock)"])
in
Quelle) has a select statement using SQL, so will only return the columns mentioned in the SQL statement. 

 

Click the settings cog next to the source (Quelle) step, expand 'Advanced Options' and add the name of the new column you want to the 'SELECT ' statement. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy, so if I get this right, (vFactOrderInvoice) should automatically add new field? So this like select *?

@mikro87  You may need to click the 'refresh preview' button to see the new columns in Power Query.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Correct @mikro87 , your fact table query does not appear to have any columns selected, so is identical to select * 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.