Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a DAX formula that calculates the number of employees who have departed in the last 12 months and it works well.
I am just trying to add to the formula an additional filter where the 'departure flag' equals 1 but it is giving me this error:
'DAX compariosn operations do not support comparing values of type True/False with values of type Integer.'
Here is the DAX formula, with the additional part that is giving me the error I have added in red
Departed past 12 months =
VAR selectedDate = LASTDATE('Date Table'[Date])
VAR selectedDate12MonthsBefore = NEXTDAY(SAMEPERIODLASTYEAR(selectedDate))
RETURN
CALCULATE(
DISTINCTCOUNT('All Employees'[Full Name]),
FILTER(
ADDCOLUMNS(
'All Employees',
"Departed Past 12 months", IF([Termination Date]>=selectedDate12MonthsBefore && [Termination Date]<=selectedDate,1,0) && 'All Employees'[Departure Flag] = 1) ,[Departed Past 12 months] = 1))
I have tried to use the VALUE and FORMAT functions to change the Departure Flag and I have also changed it between text, whole number and 'any' in Power Query and I still get the same error every time.
Please help!
Solved! Go to Solution.
Thank you, I changed it around so the part of the formula that was causing the issue is now at the start of the formula and it works:
You put the condition without checking it.
In my opinion, you need to put your condition in If Function against the out of it
Thank you, I changed it around so the part of the formula that was causing the issue is now at the start of the formula and it works:
@_Amy_ , Try like
"Departed Past 12 months", IF([Termination Date]>=selectedDate12MonthsBefore && [Termination Date]<=selectedDate && 'All Employees'[Departure Flag] = 1 && [Departed Past 12 months] = 1,1,0)
Thank you, I tried that but it didn't work.
The "[Departed Past 12 months]" is the name of the measure I am creating here so I can't use it in the formula like that.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!