Forum Discussion
Is it possible to enter Boolean values in Text data type column? If yes, How?
- 3 years ago
RamaKrishna8989 This is merely showing you what the results are for each individual event if it were its own column. It's not saying that the outcome of mixed formatted records in a column would automatically calculate the specific output as it is listed in that table. Below is an example of what I mean:
1. The column True/False is boolean structured. Therefore TRUE = 1 and FALSE = 0.
2. The column 1/0 has a blank, a zero and ones. The output is the Measure 1/0s which aligns to the AVERAGEA output.
Hope this makes sense.
Theo 🙂
Here, TRUE and FALSE are considered as Text, i want them to be considered as Boolean so my calculation happens correctly.
TheoC, If i am modifying values if working as expected. However, i am trying to replicate something like the below example.
Here, the Amount column has "TRUE" boolean value for Transaction id = 0000126. How is this considered as a boolean value to result in the value as "1"
- TheoC3 years agoCommunity Champion
RamaKrishna8989 with the example you've provided, you can use conditional statements such as IF or SWITCH TRUE to achieve what you are after. For example, you can create a Calculated Column and use the below:
Calculated Column = SWITCH ( TRUE() 'Table'[Amount] = "1" , 1 , 'Table'[Amount] = "20" , 20 , 'Table'[Amount] = "n/a" , 0 , 'Table'[Amount] = "" , 0 , 'Table'[Amount] = "TRUE" , 1 )The above is aligned to the example image you provided and you can switch the "Amount" column to "Col1" to meet your version from the original post.
Let me know if that makes sense?
Theo 🙂
- RamaKrishna89893 years agoHelper I
TheoC, but the above calculated column is all done with just averagea function as shown in the screenshot. Wondering how was that possible.
- TheoC3 years agoCommunity Champion
RamaKrishna8989 please send link.