We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I keep getting the error 'The function COUNTX cannot work with values of type Boolean.' but as far as I can tell I'm working with numbers not Boolean data.
I have a column called 'Hotel Eligible' that is all 1s or 0s but the data type is set to Whole number.
I am just using a basic measure (below) to test it but am getting the above error - does anyone know what might be causing that? Or they best way to get round it? Sorry for basic question - I'm new to this.
Proportion Hotel Eligible = DIVIDE(COUNTX('Air Detail - Leg (Depart)','Air Detail - Leg (Depart)'[Hotel Eligible]>0),COUNTA('Air Detail - Leg (Depart)'[Hotel Eligible]))
Solved! Go to Solution.
Hi @hjg_1234
Make sure that your data type for this field is Whole number, you can replace countx() with a calculation
roportion Hotel Eligible = DIVIDE(COUNTROWS(FILTER(ALLSELECTED('Air Detail - Leg (Depart)'),[Hotel Eligible]>0)),COUNTA('Air Detail - Leg (Depart)'[Hotel Eligible]))
And if it cannot work, can you provide some sample picture of the error meaasage?
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @hjg_1234
Make sure that your data type for this field is Whole number, you can replace countx() with a calculation
roportion Hotel Eligible = DIVIDE(COUNTROWS(FILTER(ALLSELECTED('Air Detail - Leg (Depart)'),[Hotel Eligible]>0)),COUNTA('Air Detail - Leg (Depart)'[Hotel Eligible]))
And if it cannot work, can you provide some sample picture of the error meaasage?
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |