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
sputnik76
Frequent Visitor

Struggling with filters and calculate

I have a table of users that I want to count and then filter out the ones that are no longer active.  I have a table (users) that contains a column of names (full name) and a column called 'is_active' with either 1 or 0 to indicate if they are/are not active users.  I'm trying to filter the measure to give me what I want but it's simply not working and other than some vague error message I'm a bit in the dark.

 

Error message on the visual is " Error Message: MdxScript(Model) (24, 70) Calculation error in measure 'users'[Num users]: DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."

 

I'm doing this;

 

Num users = CALCULATE(COUNT(users[full name]),users[is_active]="1")
 
Can anyone shed any light on what I am doing wrong here?
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @sputnik76 ,

Try removing "" as below

 

Num users = 
CALCULATE(
    COUNT(users[full name]),
    users[is_active] = 1 
)

Hope this helps

Mariusz

 

View solution in original post

3 REPLIES 3
Baskar
Resident Rockstar
Resident Rockstar

Num users = CALCULATE(COUNT(users[full name]),filter(users,users[is_active]=1))

 

Try this 

Mariusz
Community Champion
Community Champion

Hi @sputnik76 ,

Try removing "" as below

 

Num users = 
CALCULATE(
    COUNT(users[full name]),
    users[is_active] = 1 
)

Hope this helps

Mariusz

 

Works, thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.

Top Solution Authors
Top Kudoed Authors