Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi,
I have a custom column that is returning exactly what I want. That is, if a number is in "en-Us" use locale otherwise regional:
= Table.AddColumn(RemCol3, "Custom", each try Number.FromText([Custom1], "en-US") otherwise Number.FromText([Custom1]))
But the column "Custom" is returning as type any. According to documentation is possible to return as type number right?
Number.FromText(text as nullable text, optional culture as nullable text) as nullable number
I tried this with no succes. Any help?
= Table.AddColumn(RemCol3, "Custom", each try Number.FromText([Custom1], "en-US")as number otherwise Number.FromText([Custom1])as number)
Solved! Go to Solution.
Hi @Fcoatis ,
Based on your description, you can modify your M-query a little.
= Table.AddColumn(RemCol3, "Custom", each try Number.FromText([Custom1], "en-US") otherwise Number.FromText([Custom1]), type number)
You need to define your data type of this column, or the default type is "any".
Here is my test result.
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Fcoatis ,
Based on your description, you can modify your M-query a little.
= Table.AddColumn(RemCol3, "Custom", each try Number.FromText([Custom1], "en-US") otherwise Number.FromText([Custom1]), type number)
You need to define your data type of this column, or the default type is "any".
Here is my test result.
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@amitchandak Thanks for your suggestion. I know I can change the type in an additional step. I was wondering if I can change the type in one step, as mentioned in the code above?
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 31 | |
| 24 | |
| 22 |
| User | Count |
|---|---|
| 134 | |
| 111 | |
| 57 | |
| 44 | |
| 37 |