Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I use Flag columns all the time with 1 and 0 (1=Yes and 0=No). In this helpful blog post https://powerbi.microsoft.com/en-us/blog/best-practice-rules-to-improve-your-models-performance/ one of the best practices in the formatting section says: Format flag columns as Yes/No value strings.
How exactly do I do this? I see a True/false option under Data type, but I do not see Yes/No here or in the Format drop-down.
Solved! Go to Solution.
Hi @Shelley
What that article means is have a column of strings (Data Type : Text) and use either "Yes" or "No".
You'll need to amend your flag to output the text "Yes" or "No" rather than 1 or 0.
Creating a column containing "Yes" or "No" will automatically make it a Text (String) data type.
regards
Phil
Proud to be a Super User!
Hi @Shelley
What that article means is have a column of strings (Data Type : Text) and use either "Yes" or "No".
You'll need to amend your flag to output the text "Yes" or "No" rather than 1 or 0.
Creating a column containing "Yes" or "No" will automatically make it a Text (String) data type.
regards
Phil
Proud to be a Super User!
Thanks, @PhilipTreacy Traditionally, we've always been taught integers process better and faster than text. Is this no longer the case with Yes/No in Power BI?
Hi @Shelley
Actually I'm with you. I think on re-reading that article I have mis-understood what they meant. It doesn't explicitly say that flag columns should be integer but that makes sense for the reason you state. I think they mean that you should use a custom format to display 1 and 0 and Yes and No.
In which case you can do this by using this Custom Format String on your Whole Number Flag column.
"Yes"; ;"No";
Sorry for the confusion.
Regards
Phil
Proud to be a Super User!
My assumption is the author meant True/false however you should also respond to the blog post with your question.
Proud to be a Super User!
Glad you posted in the original blog post. I hope the author expands on this.
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |