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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
CoreyLearnsBI
Frequent Visitor

Adding More Than One Custom Column

How do I get my query to show all 4 custom columns I've created? It's only showing 1 of the 4 custom columns, despite having 4 separate steps to add 4 custom columns.

 

Here is an example of 1 of the DAX statements I've written to add leading zeroes.

= Table.AddColumn(#"Changed Type", "Grouper ID (With Zeroes)", each Text.PadStart(Text.From([GRPR_ID] ),8,"0"))

7 REPLIES 7
Chewdata
Super User
Super User

Can you post the entire M-code for the query?

Go to advanced editor and copy.

Like @Anonymous says, you should reference the previous step in your code. The code should look something like this:

let
    Source = YOURSOURCE,
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Input", Int64.Type}}),
    add_Custom1 = Table.AddColumn(#"Changed Type", "Custom1", each [Input] + 1),
    add_Custom2 = Table.AddColumn(add_Custom1, "Custom2", each [Input] + 2),
    add_Custom3 = Table.AddColumn(add_Custom2, "Custom3", each [Input] + 3),
    add_Custom4 = Table.AddColumn(add_Custom3, "Custom4", each [Input] + 4)
in
    add_Custom4

 all steps are referencing the previous step. Finaly the last step is referenced in the 'in' part of the code, so all steps are evaluated and loaded.

ronrsnfld
Super User
Super User

That is not a DAX statement, that is M-Code.

What is the code for the other columns?

Anonymous
Not applicable

Did you make sure to alter the first argument in your Table.AddColumn argument?
If you copy&pasted it, you might have not done that.

More specifically, if the first argument is #"Changed Type" for every step, PowerBI will only be able to perform the first step. For any subsequent step, PowerBI will look for a table called Changed Type to manipulate, but your first step changed the table name to whatever name you put in front of the equation sign.

Greg_Deckler
Community Champion
Community Champion

@CoreyLearnsBI That sounds really odd. Are you sure you have clicked on the last step of the Applied Steps pane over on the right?



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I am hovering over the last step in the "Applied Steps" pane. Is there a limit for the number of columns you can have in a dataset? This is a very large CSV file with 24 fields before adding the additional 4 customized columns.

Anonymous
Not applicable

Pretty certain that should not be the issue. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.