March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Everyone,
I am adding an addtional column in my table in data window and performing an if statement.
Statement : Column=IF(Table[Distance]=0,"-",100-(100*Table[Reversing Upon Vehicle Start Up]/Table[COUNT]))
I also want to add more column with different formulae like
I am unable to get "-" when I am running the statement reason is my output would be a numeric number so I want to change my data type as Any so that I can perform the analysis.
Note: I don't want to change the type as String becuse I want to pefrom some mathematical calulcations also want to add other columns consisting Max,Min conditions. Is there any if I can add a custom column in query editor and can apply some If, Max, Min condition in column and change data type as "Any"
Please see the below table and expected column output
Distance | Count | Column |
0 | 6 | - |
0 | 8 | - |
0 | 13 | - |
0 | 15 | - |
0 | 11 | - |
1 | 7 | 0.142857 |
1 | 13 | 0.076923 |
21 | 14 | 1.5 |
16 | 12 | 1.333333 |
25 | 16 | 1.5625 |
25 | 15 | 1.666667 |
32 | 17 | 1.882353 |
4 | 8 | 0.5 |
31 | 4 | 7.75 |
39 | 20 | 1.95 |
39 | 8 | 4.875 |
5 | 5 | 1 |
33 | 13 | 2.538462 |
13 | 20 | 0.65 |
20 | 11 | 1.818182 |
40 | 5 | 8 |
24 | 20 | 1.2 |
Distance | Count | Column |
0 | 6 | - |
0 | 8 | - |
0 | 13 | - |
0 | 15 | - |
0 | 11 | - |
1 | 7 | 0.142857 |
1 | 13 | 0.076923 |
21 | 14 | 1.5 |
16 | 12 | 1.333333 |
25 | 16 | 1.5625 |
25 | 15 | 1.666667 |
32 | 17 | 1.882353 |
4 | 8 | 0.5 |
31 | 4 | 7.75 |
39 | 20 | 1.95 |
39 | 8 | 4.875 |
5 | 5 | 1 |
33 | 13 | 2.538462 |
13 | 20 | 0.65 |
20 | 11 | 1.818182 |
40 | 5 | 8 |
24 | 20 | 1.2 |
Kindly help
Regards
Uphar Tandon
Solved! Go to Solution.
Why would string prevent you from doing your mathematical calculations? Store as string, and then when you do want to do your calculation (and you are confident the stored string is actually a number and not just a "-") you convert the value programmatically to number.
Or, you know, you could use BLANK() instead of "-", and not have these issues at all.
Hi @Anonymous ,
Apart from what Ibendin has mentioned, the formula for MAX is wlso incorrect.
MAX takes in Column as an input while you have given mathematical expression in the function.
Why would string prevent you from doing your mathematical calculations? Store as string, and then when you do want to do your calculation (and you are confident the stored string is actually a number and not just a "-") you convert the value programmatically to number.
Or, you know, you could use BLANK() instead of "-", and not have these issues at all.
Thanks for the suggestion. Its working 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
15 | |
7 | |
6 |
User | Count |
---|---|
33 | |
29 | |
16 | |
13 | |
12 |