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