Forum Discussion
Metric Switch Formatting Error
- Anonymous5 years ago
I just figured out a way to resolve it after trying every possible way. I was able to create a third metric switch statement that did the subtraction and formatting in the last metric switch used. Simple = Difficult haha
Thank you for all your help and suggestions! Radhika2605 Fowmy
Anonymous Try to enclose your Swtich statement within Value() like -
Value( Switch () )
Value will convert text to string and then you should be able to subtract it.
Could you please mark this as a solution if this answers your query.
Thanks
Radhika
Radhika2605
I am still getting the error when I wrap my switch statements in Value(Switch() ).
I am trying out your other suggestion
- Radhika26055 years ago
Helper II
Hi Anonymous If my second option (Is it possible for you to multiply the result of calculation in measures like Cancellation %, Productivity % by 100 and format then using options on the Column Toold Ribbon from the top to say that it is a % instead of using Format function in switch?) doesnt work then we can try to do these things-
1. Actually what I meant was as you mentioned that switch is converting the data type of result to text so you can do following -Value(Switch()) - Value(Swicth) //in your measure where you are subtracting two switches.
2. If the above doesnt work then can you please try to use value function outside of the Format functions so that as format is returning a text then it will be converted to Number (not entrierly sure if this will work though).
3. to check if switch is converting value to text - I would suggest to do a test. Remove the format functions so that the result of Cancellation, Productivity and all other measures is number (check the data types too before using them in switch) and then try to subtract it. In this way at least we will know if Switch is causing a problem or Format and can then see what can be done.
Thanks
Radhika
hope this clarifies.
- Anonymous5 years agoNot applicable
I just figured out a way to resolve it after trying every possible way. I was able to create a third metric switch statement that did the subtraction and formatting in the last metric switch used. Simple = Difficult haha
Thank you for all your help and suggestions! Radhika2605 Fowmy