cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
handwepg Frequent Visitor
Frequent Visitor

Why won't new column added to table show up on PowerQuery?

I've added a new column in one of my tables using the New Column button from the Modeling tab in Power BI Desktop.  However, when I go into Edit Queries from the Home tab, that new column does not appear among that table's columns in PowerQuery.

 

What am I missing?

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Why won't new column added to table show up on PowerQuery?

Hi @handwepg,

 

In the query editor you need to add a column similar to this:

 

(if [A] = null then 0 else [A]) + (if [B] = null then 0 else [B]) 

This will give 0 when the A or B column is null and sum result of both columns when you have values on both.

 

No need to change null to 0.

 

Regards.

MFelix



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

Proud to be a Datanaut!




5 REPLIES 5
Super User
Super User

Re: Why won't new column added to table show up on PowerQuery?

Hi @handwepg,

 

Power BI uses two different languages to make the calculations, on the "front end" it uses DAX a language similar to EXCEL, when you are on the query editor it uses M language.

 

Although some thing that you do on the "front end" of PBI it as a effect on the query editor, like renaming columns or deleting tables or columns, other don't are replicated in both PBI enviroments, this is the case of the creation of new columns, the fact that you are using DAX since it's a different language with different arguments it is not reflected on the query editor that's why you are no seeing the columns on the query editor.

 

Regards,

MFelix



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

Proud to be a Datanaut!




handwepg Frequent Visitor
Frequent Visitor

Re: Why won't new column added to table show up on PowerQuery?

I see. Thanks.

 

Follow up question. When I created the new column in the "front end" I was adding together two columns (e.g. A and B) to make one new column (e.g. C).  It was true in every row that either A or B had a numeric value.  If A had a value, B was null.  If B had a value, A was null.  The resulting new column C then always had a value.

 

However, when I tried "Add Column" in Power Query (i.e. DAX) and I used the same formula from the "front end," every value in the new column C comes back as null.

 

Why is that?  And, more importantly, what should I do about it?  Do I need to go back into the source table columns A and B and convert all null values to zero?

 

Thanks again

Phil

Super User
Super User

Re: Why won't new column added to table show up on PowerQuery?

Hi,

 

What exact formula are you writing in Power Query?

Super User
Super User

Re: Why won't new column added to table show up on PowerQuery?

Hi @handwepg,

 

In the query editor you need to add a column similar to this:

 

(if [A] = null then 0 else [A]) + (if [B] = null then 0 else [B]) 

This will give 0 when the A or B column is null and sum result of both columns when you have values on both.

 

No need to change null to 0.

 

Regards.

MFelix



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

Proud to be a Datanaut!




Waseem Regular Visitor
Regular Visitor

Re: Why won't new column added to table show up on PowerQuery?

Hello @handwepg

 

Click on "Edit Queries" and then on "Advanced Editor"

You will see a text restricting maximum number of columns as highlighted below:

Capture 2.JPG

 

 

In my case it is showing 158 because i have 158 columns in my table. In your case, whtever number you see here, just type one more than that (if its 9, change it to 10). Save query and you are done. your new column will be added.

 

Cheers

 

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 263 members 2,817 guests
Please welcome our newest community members: