Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I'm trying to create my first fairly custom function but simply cannot make it work.
There is something quiet fondamental that I don't get as a newbie
I want to create a column to my imported dataset, with all rows containing the same value ("A1", "A2", "A3","A?") based on the parameter passed via a custom function.
I go "Add custom function" and typed this function (that doesn't even pass the error check!!!)
(Account as number)
let
if Account = 1 then RowContent = "A1"
else if Account = 2 then RowContent = "A2"
else if Account = 3 then RowContent = "A3"
else RowContent = "A?"
L0 = RowContent
in
L0
What I'm doing wrong?
Solved! Go to Solution.
Try this:
(Account as number) as text =>
let
L0 = if Account = 1 then "A1"
else if Account = 2 then "A2"
else if Account = 3 then "A3"
else "A?"
in
L0
Try this:
(Account as number) as text =>
let
L0 = if Account = 1 then "A1"
else if Account = 2 then "A2"
else if Account = 3 then "A3"
else "A?"
in
L0
Thank you Alexis, it worked like a charm.
There is a long road ahead of me to get proficient but you helped me take my first step.
Regards,
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |