Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I want to use a flag field for if records have a given status, or are marked for deletion, etc...
I was using an Integer with a 0 for FALSE and 1 for TRUE.
Then I did a nice SUM on the field to get what I was after.
However, if I add a slicer, showing 0 and 1 is NOT user friendly.
Is there any downside to changing it to a True/False field?
I'd use COUNT instead of SUM to count the TRUE values, but other than that. Is there any downside?
Solved! Go to Solution.
@sasdfasdfsad Readability: True/False fields are more intuitive and user-friendly, especially when used in slicers or filters. Users can easily understand the meaning of True/False compared to 0/1.
Data Modeling: True/False fields are explicitly designed for boolean logic, which can make your data model more semantically correct and easier to understand.
DAX Functions: Power BI's DAX language has built-in support for boolean fields, which can simplify your calculations and improve readability.
CountOfTrueValues = COUNTROWS(FILTER(Table, Table[FlagField] = TRUE()))
Proud to be a Super User! |
|
@sasdfasdfsad I don't see any different storing 0/1 or True/False, only thing come in mind is that you cannot use True/False value in the filter page (like visual/page/report level filters) other than that I don't see any difference.
Other difference you already point out that you will use count with condition, if you want count of true or false values, although sum is always returning sum of true values.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@sasdfasdfsad also the DAX can be written like this;
CountOfTrueValues = COUNTROWS(FILTER(Table, Table[FlagField]))
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@sasdfasdfsad I don't see any different storing 0/1 or True/False, only thing come in mind is that you cannot use True/False value in the filter page (like visual/page/report level filters) other than that I don't see any difference.
Other difference you already point out that you will use count with condition, if you want count of true or false values, although sum is always returning sum of true values.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Good point about SUM still working even, I didn't process that at all. Thank you!!
@sasdfasdfsad Readability: True/False fields are more intuitive and user-friendly, especially when used in slicers or filters. Users can easily understand the meaning of True/False compared to 0/1.
Data Modeling: True/False fields are explicitly designed for boolean logic, which can make your data model more semantically correct and easier to understand.
DAX Functions: Power BI's DAX language has built-in support for boolean fields, which can simplify your calculations and improve readability.
CountOfTrueValues = COUNTROWS(FILTER(Table, Table[FlagField] = TRUE()))
Proud to be a Super User! |
|
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.