Forum Discussion
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:
Hi CatieBeth ,
I created some mockup data:
And I used this measure:
BooleanMeasure = CALCULATE ( COUNTROWS ( TableBoolean ), TableBoolean[Boolean] = true )
And I got the correct result:
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/
2 Replies
- tackytechtomMost Valuable Professional
Hi CatieBeth ,
I created some mockup data:
And I used this measure:
BooleanMeasure = CALCULATE ( COUNTROWS ( TableBoolean ), TableBoolean[Boolean] = true )
And I got the correct result:
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/ - CatieBethRegular Visitor
That worked!! Thank you so much!!!