Forum Discussion
Error: DAX comparison operations do not support comparing values of type true/false
I am trying to create a new calcuated field to count all the account names if "ValidationStatus" is TRUE. The formula I am using is :
Validated count = CALCULATE(DISTINCTCOUNT(accounts[name]),FILTER(accounts,VALUE(accounts[validationstatus])= TRUE()))
I am getting this error :
DAX Comparision operations do not support comparing values of type Number with values of type True/False. Consider using value or FORMAT function to convert one of the values.
Any help will be appriciated.
Best
P
9 Replies
- AnonymousNot applicable
Try this:
CALCULATE(DISTINCTCOUNT(accounts[name]),accounts[validationstatus])= "TRUE")
- poojikFrequent Visitor
I am still getting the same error. Screen-shot attached.
- VvelardeCommunity Champion
Hi try with this
Validated Count = CALCULATE ( DISTINCTCOUNT ( Accounts[name] ); FILTER ( Accounts; Accounts[validationstatus] = TRUE () ) )Regards
Victor
- AnonymousNot applicable
Can someone help me please. I have the following code and I keep getting this error. I have tried wrapping the calculate statement in a VALUE function and I get the message, cannot convert true/false.
Inpatient comment =var newline2 =""returnif(CALCULATE([Per Member % Change],'Benefit Mapping'[Benefit Type]="inpatient">0.05),"Inpatient Costs:" & newline2 & "The average inpatient cost per member has increased year-over-year by " &FORMAT(CALCULATE([Per Member % Change],'Benefit Mapping'[Benefit Type]="inpatient"), "currency")& ". IP costs are sporadic in nature and can significantly increase or decrease overall costs; in this instance, IP increased overall costs",if (AND(CALCULATE([Per Member % Change],'Benefit Mapping'[Benefit Type]="inpatient")<=0.05,CALCULATE([Per Member % Change],'Benefit Mapping'[Benefit Type]="inpatient")>=-0.05 ),"inpatient Costs: " & newline2 & "The average inpatient cost per member has been roughly stable year-over-year (" &FORMAT(CALCULATE([Per Member % Change],'Benefit Mapping'[Benefit Type]="inpatient"), "currency")& " change year-over-year. IP costs are sporadic in nature and can significantly increase or decrease overall costs; in this instance, IP had minimal impact on overall costs","Inpatient Costs:" & newline2 & "The average inpatient cost per member has decreased year-over-year by " &FORMAT(CALCULATE([Per Member % Change],'Benefit Mapping'[Benefit Type]="inpatient"), "currency")& ". IP costs are sporadic in nature and can significantly increase or decrease overall costs; in this instance, IP reduced overall costs"))