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.
Hello,
While I create a field-parameter for my model, I give a specific name (let's call it Dimensions).
In the furhter creation process of Dimensions, I need to add more columns for each row/field (each row/field needs to have a different value, so I go via DAX). The new column, gets by default a specific name. In my case "Value4". If I create more columns there is a sequence in said name (Value5, Value6, etc.)
Obviously, I need to rename the column, using a more representative name. However, I get an unexprected error with the message "Error Applying Change". I face the same issue when I am trying to rename an already existed field-parameter that I created in the past.
P.S1. the Power BI Version I am using is 2.110.805.0 64-bit (October 2022)
Thanks in advance!
Solved! Go to Solution.
I does look like a bug, I agree.
BTW I wasn't trying to imply that a calculated column is "better" (normally it is advisable to avoid calculated columns where possible, so writing the code into the table constructor is probably better). I was suggesting an alternative way to include the columns as per the original poster's needs seeing as changing the column name wasn't working.
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown @thomasblt I can confirm that this seems to be a bug with the October version; it works fine with the September version or earlier. I opened an issue with a lot of details and a link to an example pbix file. Please review and upvote.
@PaulDBrown Your workaround works but it requires the values of the new column to be defined by a logic; we may want to manually enter the values by hand, e.g. create a category for each value that it cannot be deduced by some other column value. Besides, this is something that worked for the September and earlier versions and it stopped working on the October version, so to me it looks like a bug.
I'm with you...but what I don't get is this part:
"We may want to manually enter the values by hand, e.g. create a category for each value that it cannot be deduced by some other column value"
In my second example, I indeed entered values "by hand". Unless you need random values by row (for which we have the RAND function for the final numeric value or to use in a SWICTH function) or a constant value (for which you simply make the column value = whatever you need, you are going to have to assign values by row, which is what I have done in the second example:
which is the equivalent of
And to add values by row or group of rows, you are going to need to reference another column
Maybe I'm being obtuse, but I can't see how the creation of a new column doesn't cater for the "manual" option. If there were dozens/hundreds of rows, it could become and issue. But we are talking about a Field Parameter table, in which the number of rows should be pretty limited.
Any chance you provide an example of how we may need to assing row values without referencing another column?
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrownAh ok, I understand what you mean now. Yes, we can define a formula that does the job, but maybe there are cases where it is more readable to do it directly on the defining power query formula. For some cases (table of field parameters with a few rows) maybe I'd rather see it written like this, instead of having a switch formula. But whether this is a "better way" of course is subjective! In any case, at the end of the day I do believe that there is a bug here worth reporting.
I does look like a bug, I agree.
BTW I wasn't trying to imply that a calculated column is "better" (normally it is advisable to avoid calculated columns where possible, so writing the code into the table constructor is probably better). I was suggesting an alternative way to include the columns as per the original poster's needs seeing as changing the column name wasn't working.
Proud to be a Super User!
Paul on Linkedin.
Yes, I understand! That was a working alternative indeed.
How are you adding the new column?
I just tried adding a new column in table view and it seems to load ok:
Proud to be a Super User!
Paul on Linkedin.
When I created the field-parameter "#Parameters-Dimensions" , an automared DAX was created as you can see below (colors red and black).
So each time I needed a new column I was manually writing in this DAX (colours orange, green, blue).
A few weeks ago I could rename column #3 & #4 (from Value3 to Order & from Value4 to Category), but now I face the issue i described above.
PS. Unfortunately , values in column #5 have to be imported manually. Your example could work perfect for my case if there was a logic behind. (the screenshot shows only a few of the rows. Column #5 has multiple values, not only 0,1)
I'm getting the same behaviour: it won't let me rename the columns.
I can create a new column once loaded for Category as follows:
Can't you use the SWITCH function and reference the Parameter[Order] field to assign the values? Or use a different DAX expression to return the values?
After all you are assigning them manually with the table constructor { }
Proud to be a Super User!
Paul on Linkedin.
Yes, this could be a workaround in my case.
However, it seems to be a bug of the new version of Power BI. I tried to download a previous one (September's version) and it worked.
Thanks again for your help! 🙂
I'm not sure what you mean. can you post a depiction?
Proud to be a Super User!
Paul on Linkedin.
Hey,
Here is a table-view of my field-parameter called Dimensions.
As you can see each row is a different parameter, with different values per column (column #2 - "Field" is hidden as there might be some sensitive info). What I need is to rename the last column "Value5".
I am also sharing with you the extended screenshot, where DAX can be seen (screenshot 1) and the error that shows up when I am trying to rename the column (screenshot 2)
Screenshot 1
Screenshot 2
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |