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 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
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.
Hi try with this
Validated Count = CALCULATE ( DISTINCTCOUNT ( Accounts[name] ); FILTER ( Accounts; Accounts[validationstatus] = TRUE () ) )
Regards
Victor
The data type in Power BI desktop is True/False and the solution
Validated Count = CALCULATE ( DISTINCTCOUNT ( Accounts[name] ); FILTER ( Accounts; Accounts[validationstatus] = TRUE () ) )
works for power BI desktop. But when I publish the report on Power BI pro online. The data values chages to 0 and -1 hence the solution doesn't work.
I am not able to edit the expression in power BI pro to make it compatible.
Hi @poojik,
Can you share a sample of the data?
Best Regards,
Dale
The test data is attached. The data is downloaded from Dynamics CRM accounts entity. There are 6 fields with data in 14 rows :
1. Name : Text field
2. Validation status : Option set
3. Created on : Date and Time field
4. Rsubmitted : Option set
5. Units : Whole Number
6. Region : Text field
'
Now because I have to find out the absolute percentage of names that has Rsubmitted as "Yes" (example out of 4 Toronto records 3 has Rsubmitted as "Yes". Hence the percentage is 75%)
To find out hte percentage i have created a calcuated field :
Validated count =CALCULATE(DISTINCTCOUNT(accounts[name]),accounts[Rsubmitted]= "TRUE")
Absolute_percentage = (([Validated count])/(count(accounts[Name])))
The calculations are valid and am able to plot stacked bar graph (Screen-shot attached)
But when I try to publish this graph to Power BI pro- the data type for Rsubmitted" changes from TURE/FLASE to 1/0 (Screen-shot attached)
Try this:
CALCULATE(DISTINCTCOUNT(accounts[name]),accounts[validationstatus])= "TRUE")
I am still getting the same error. Screen-shot attached.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |