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.
I am looking for help with my ReplaceValue statement. I pull some code from other discussions but was unsucessful in getting the statement to work appropriatly.
Here is what I have:
#"Replaced Value in Supervisor" = Table.ReplaceValue(Source, each [Supervisor],
each if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" then "Ralph"
else Replacer.ReplaceValue,{"Supervisor"})
I get this error:
Expression.Error: 4 arguments were passed to a function which expects 5.
Details:
Pattern=
Arguments=[List]
Eventually I want to get to this:
#"Replaced Value in Supervisor"= Table.ReplaceValue(Source, each [Supervisor],
each if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" then if [Worker] = "Sue" then "Ralph"
else if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" then if [Worker] = "Anna" then "Stan"
else if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" then if [Worker] = "Pete" then "George"
else Replacer.ReplaceValue,{"Supervisor"})
Solved! Go to Solution.
Solved my issue:
= Table.ReplaceValue(Source,each [Supervisor],
each if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" and [Worker]="Sue" then "Ralph"
else if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" and [Worker]="Anna" then "Stan"
else if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" and [Worker]="Pete" then "George"
else [Supervisor],Replacer.ReplaceValue,{"Supervisor"})
= let sup = Record.FromList({"Ralph","Stan","George"}, {"Sue","Anna","Pete"}) in Table.ReplaceValue(Source, each [Supervisor], each if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" then Record.FieldOrDefault(sup, [Worker], [Supervisor]) else [Supervisor], Replacer.ReplaceValue, {"Supervisor"})
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
= let sup = Record.FromList({"Ralph","Stan","George"}, {"Sue","Anna","Pete"}) in Table.ReplaceValue(Source, each [Supervisor], each if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" then Record.FieldOrDefault(sup, [Worker], [Supervisor]) else [Supervisor], Replacer.ReplaceValue, {"Supervisor"})
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Solved my issue:
= Table.ReplaceValue(Source,each [Supervisor],
each if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" and [Worker]="Sue" then "Ralph"
else if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" and [Worker]="Anna" then "Stan"
else if [Supervisor]="Not Assigned/Non affecté Not Assigned/Non affecté" and [Worker]="Pete" then "George"
else [Supervisor],Replacer.ReplaceValue,{"Supervisor"})
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 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |