Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, I just changed my Data source for my POwer Bi Dashboard I have added some new columns. When I Change the source the new columns are not included in the data set. I tried to add them in the advance editor and got the "Expression.Error: We expected newColumnNames to have the same number of items as columnNames". I have tried to refresh the data, to add columns, but nothings seems to work. Help, please!
Solved! Go to Solution.
@Pinita06 OK, this would have been easier with text. Expand Columns takes 4 parameters typically. There is the table, the column you want to expand in that table and then 2 lists. The first list is the name of the columns that you want to end up with and the second list is the column name that you want out of the expanded column. You need to have the same number of entries in both lists.
I had the same issue in the past and I solved it in a different way.
In the affected Query -> Advanced Editor, in the "let" section look for the Columns descriptor. You can do one of 2 things:
1. increase the number with the new(ly) added columns. Let's say you had 10 columns and you've added 2 more then you have to change the number to 12
2. (what I did) I changed the number to null (no brackets, no nothing). This way, you don't have to do anything if you add new columns in the future.
Hope it works for you.
Hi, I looked for the #Columns and I can't find it...
This is my Historical in the Advance editor:
This is how I'm adding the columns.
What do you have in Source? My Query -> Advanced Editor looks like the snapshot and you can see highlighted the number of columns. If I what to add more colomns to the source (Campaign.csv) then I'll have to change this number accordingly.
@Pinita06 Can you share the relevant before and after M code from Advanced Editor? Generally this happens when you added column names but not the actual columns in the expression or vice versa. You generally have to enter it twice into the expression (the name of the column).
@Pinita06 OK, this would have been easier with text. Expand Columns takes 4 parameters typically. There is the table, the column you want to expand in that table and then 2 lists. The first list is the name of the columns that you want to end up with and the second list is the column name that you want out of the expanded column. You need to have the same number of entries in both lists.
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
41 |
User | Count |
---|---|
108 | |
53 | |
50 | |
40 | |
40 |