Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
CatieBeth
Regular Visitor

Convert True/False to 0 & 1 off Calculated Field

I have a Calculated field showing where I need to see how many installs are pending from 0-14 days the calcualtion is:0-14 Days = 'Drop Installs'[Days Past Due]<=14  (I got the Days Past Due from another calculation if this info is needed:  (Days Past Due = TODAY() -'Drop Installs'[Splicer Due Date])

 

How can I convert  True/False to 1 and 0

 

I have treid the following but receive errors:

SWITCH (Drop Installs'[0-14 Days], "TRUE", "1", "FALSE", "0" )

INT('0-14 Days'[TRUE1] = '0-14 Days'[FALSE0])

 

This just returns the same count for ture and false:

CALCULATE ( COUNTROWS ( 'Drop Installs'), FILTER( 'Drop Installs' , 'Drop Installs'[0-14 Days] = TRUE()))
1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @CatieBeth ,

 

I created some mockup data:

tomfox_0-1655842215812.png

 

 

And I used this measure:

BooleanMeasure = CALCULATE ( COUNTROWS ( TableBoolean ), TableBoolean[Boolean] = true )

 

And I got the correct result:

tomfox_1-1655842283641.png

 

Maybe you wanna try the same syntax as my statement above to start with?

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
CatieBeth
Regular Visitor

That worked!!   Thank you so much!!!

tackytechtom
Super User
Super User

Hi @CatieBeth ,

 

I created some mockup data:

tomfox_0-1655842215812.png

 

 

And I used this measure:

BooleanMeasure = CALCULATE ( COUNTROWS ( TableBoolean ), TableBoolean[Boolean] = true )

 

And I got the correct result:

tomfox_1-1655842283641.png

 

Maybe you wanna try the same syntax as my statement above to start with?

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.