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 🙂
Hi RamaKrishna8989 yes, this can certainly be done. Just add " " at the start and end of the condition to determine whether the condition you're putting forward is TRUE/FALSE.
If I've misunderstood your question, please feel free to add an example of what you're referring to.
Thanks,
Theo
Here, TRUE and FALSE are considered as Text, i want them to be considered as Boolean so my calculation happens correctly.
- TheoC3 years agoCommunity Champion
RamaKrishna8989 If your source data contains Col 1 and the source data has 1, FALSE, One, TRUE, then you will need to modify the data in Col 1 in the raw source file.
The boolean output should be based on a condition being met or not being met. For example:
I hope this makes sense?
Thanks heaps
Theo
- TheoC3 years agoCommunity Champion
RamaKrishna8989 In addition to the above, your entire Col1 should be TRUE or FALSE if you are wanting it to be treated as such. Once you do that, you can go into Power Query by pressing "Transform Data" and then simply click the "abc" on the column like below:
Once you've done that you can click on "TRUE/FALSE"
This will convert the column to a boolean like below:
Hope this is what you're wanting.
Theo 🙂
- RamaKrishna89893 years agoHelper I
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.