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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
hoyty
Regular Visitor

CountAX errror with True/False vs Integer

I am trying to make a measure like this

AbsentCount = COUNTAX(FILTER('Attendance Review','Attendance Review'[Absent] = TRUE() && ISBLANK('Attendance Review'[SignoutTime])),'Attendance Review'[Absent])

When I try to pull that measure into a table I get this message

Couldn't load the data for this visual

MdxScript(Model) (37, 76) Calculation error in measure 'Attendance Review'[AbsentCount]: DAX comparison operations do not support comparing values of type True/False with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

 

This is pulling data from an Azure SQL view. The Absent column is of type boolean. I tried = 1 as well and got same error. I tried removing the && and second expression and got same error as well. Not sure what I am doing wrong.

1 ACCEPTED SOLUTION

hi @hoyty ,

 

the issue is now clear: 

null and 1 are of different data type. Try to change all null to 1 in PQ, then your measure shall work. 
How:

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @hoyty ,

 

could you post some sample data of the absent column?

Hi,

It is boolean that is generally either NULL or 1. Ocassionally it is a 0 due to someone being marked absent and then cleared. This is from SQL SMS.

hoyty_0-1699314466968.png

 

hi @hoyty ,

 

the issue is now clear: 

null and 1 are of different data type. Try to change all null to 1 in PQ, then your measure shall work. 
How:

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.