The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Community
I need to create a column based on an international encoding called ISIC that goes something like this:
CIIU
0990
1850
0114
3311
4560
I'm creating the column with the following code:
The column is throwing me the error of not being able to compare text-like values as integer values, but, as you can see in the example, there are codes that start with zero '0' and therefore I cannot transform the data to numbers. What do you recommend for this case?
Solved! Go to Solution.
VAR theCI = VALUE(VR_PBI_COMERCIANTES[CIIU1])
Hi @juandroid ,
I think I understand what you mean, your error is that the CIIU column is in text format, so an error occurred when running the formula. You should use VALUE() to turn your text into numbers and then compare them.
Should be modified to
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
VAR theCI = VALUE(VR_PBI_COMERCIANTES[CIIU1])
Create a variable using VALUE(theField) and use that in the comparisons.
It means less typing too.
The last line of the switch is using a different field. Correct?
I don't quite understand your answer, could you please explain a little more?
I think this should work if you change the "&" after 4911 to "&&".
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
77 | |
72 | |
46 | |
39 |
User | Count |
---|---|
136 | |
108 | |
69 | |
64 | |
56 |