Forum Discussion
Unable to see function values in custom column
I am new Fabric/PowerBI user facing an issue with custom column in the dataflow gen2. After creating custom columns with formula, I am not seeing the column values in the preview or after publishing the data. I only see the text "function" in the output data.
Looking for any experienced users who can help me sort this one out
- Anonymous1 year ago
Hi pbeeram ,
Based on the Power Query code, your Text.Contains code format is being used incorrectly. Try using the following code.
let source = DB2.Database(""), #"Added Custom" = Table.AddColumn(source, each if [DIVIS] = "HDUSMS" and not Text.Contains([DEALER], "1087") and not Text.Contains([DEALER], "7955") and not Text.Contains([DEALER], "7955") then "Y" else "N"), #"Added Custom1" = Table.AddColumn(#"Added Custom", "FINCODE 5", each Text.Range([FINCODE], 0, 5), type text) in #"Added Custom1"You should view the following link to learn more information about power query M code.
Text.Contains - PowerQuery M | Microsoft Learn
List.Contains - PowerQuery M | Microsoft Learn
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- lbendlinSuper User
probably too liberal use of "each" . Show your Power Query code.
- pbeeramNew Member
- AnonymousNot applicable
Hi pbeeram ,
Based on the Power Query code, your Text.Contains code format is being used incorrectly. Try using the following code.
let source = DB2.Database(""), #"Added Custom" = Table.AddColumn(source, each if [DIVIS] = "HDUSMS" and not Text.Contains([DEALER], "1087") and not Text.Contains([DEALER], "7955") and not Text.Contains([DEALER], "7955") then "Y" else "N"), #"Added Custom1" = Table.AddColumn(#"Added Custom", "FINCODE 5", each Text.Range([FINCODE], 0, 5), type text) in #"Added Custom1"You should view the following link to learn more information about power query M code.
Text.Contains - PowerQuery M | Microsoft Learn
List.Contains - PowerQuery M | Microsoft Learn
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.