Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Instead of adding columns one at a time using dax is it possible to add multiple columns in one go? I can break the code up below to add one column at a time and it works, but when I try to combine it into one dax statement it doesn't.
Solved! Go to Solution.
Hi @barrymac98
If you want to add multiple columns at one time, you need to use calculated table, because it will return multiple columns, you cannot create them directly at the existed table. you can refer to the following sample.
Create a calculated table
Table2 =
ADDCOLUMNS (
'Table',
"Alice",
SWITCH (
TRUE (),
'Table'[Name] = "Alice", "Alice",
'Table'[Name] = "Bob", UNICHAR ( 8203 ),
'Table'[Name] = "Carol", REPT ( UNICHAR ( 8203 ), 2 ),
BLANK ()
),
"Bob",
SWITCH (
TRUE (),
'Table'[Name] = "Alice", UNICHAR ( 8203 ),
'Table'[Name] = "Bob", "Bob",
'Table'[Name] = "Carol", REPT ( UNICHAR ( 8203 ), 2 ),
BLANK ()
),
"Carol",
SWITCH (
TRUE (),
'Table'[Name] = "Alice", REPT ( UNICHAR ( 8203 ), 2 ),
'Table'[Name] = "Bob", UNICHAR ( 8203 ),
'Table'[Name] = "Carol", "Carol",
BLANK ()
)
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @barrymac98
If you want to add multiple columns at one time, you need to use calculated table, because it will return multiple columns, you cannot create them directly at the existed table. you can refer to the following sample.
Create a calculated table
Table2 =
ADDCOLUMNS (
'Table',
"Alice",
SWITCH (
TRUE (),
'Table'[Name] = "Alice", "Alice",
'Table'[Name] = "Bob", UNICHAR ( 8203 ),
'Table'[Name] = "Carol", REPT ( UNICHAR ( 8203 ), 2 ),
BLANK ()
),
"Bob",
SWITCH (
TRUE (),
'Table'[Name] = "Alice", UNICHAR ( 8203 ),
'Table'[Name] = "Bob", "Bob",
'Table'[Name] = "Carol", REPT ( UNICHAR ( 8203 ), 2 ),
BLANK ()
),
"Carol",
SWITCH (
TRUE (),
'Table'[Name] = "Alice", REPT ( UNICHAR ( 8203 ), 2 ),
'Table'[Name] = "Bob", UNICHAR ( 8203 ),
'Table'[Name] = "Carol", "Carol",
BLANK ()
)
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Makes sense! thank you 🙂
Not sure what you mean,
but u can use addcolumns function in dax to add as many as you want
But can I create multiple columns with just one AddColumns call?
I seem to only be able to create one column per addcolumn call
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |