cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BBIUser Member
Member

Error DAX comparison operations do not support comparing values of type Text with values of type Int

Hi,

 

How do I show the result set in a 'Multi-row card of only 0 values from the Custom Column? 

Sample data is provided below:

multi.png

 

- Difference is a Custom Column which I created in the Power Query Editor [Example 'Diff' shown in above image]

"Column 2 - Column 1"

- Next, I have created a MEASURE to place them in the Multi-row card.

Measure = CALCULATE(COUNTROWS(FILTER('Table1', 'Table1'[Diff]=0)))

 

This is when I get an calculation error in measure. Do I need to use some other expression?

 

Appreciate your response. Thanks!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

@BBIUser

 

Seems to me that DIFF column is formatted as text.

 

Try this

 

Measure =
CALCULATE ( COUNTROWS ( FILTER ( 'Table1', VALUE ( 'Table1'[Diff] ) = 0 ) ) )
Community Support Team
Community Support Team

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

Hi @BBIUser

 

You may try to change the type of Diff column to 'Whole Number'. Then your measure will not get the error.

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 REPLIES 6
Moscuba Member
Member

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

Try:

 

Measure = CALCULATE( COUNTROWS( 'Table1'[Diff] ) , FILTER('Table1', 'Table1'[Diff]=0 ) )

 

CALCULATE( What to Calculate , Filter or other expression )

BBIUser Member
Member

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

Thanks @Moscuba for the reply.

I did try this expression before posting here with slight modification in it and I was getting the same error . I dint place ('Table1'[Diff]) , the coulmn since I had used the Custom Column which is not showing while creating this expression and shows only the Table Name for COUNTROWS.

 

Measure = CALCULATE( COUNTROWS( 'Table1') , FILTER('Table1', 'Table1'[Diff]=0 ) )

 

Super User
Super User

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

@BBIUser

 

Seems to me that DIFF column is formatted as text.

 

Try this

 

Measure =
CALCULATE ( COUNTROWS ( FILTER ( 'Table1', VALUE ( 'Table1'[Diff] ) = 0 ) ) )
Community Support Team
Community Support Team

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

Hi @BBIUser

 

You may try to change the type of Diff column to 'Whole Number'. Then your measure will not get the error.

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BBIUser Member
Member

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

I was trying to change the Measure's data type to Whole number instead of the Custom Column. Changing the Custom Column to Whole Number data type with my original DAX worked for me as suggested by Cherie.

 

Thanks for the Solutions @v-cherch-msft , @Zubair_Muhammad and @Moscuba.

digirla New Member
New Member

Re: Error DAX comparison operations do not support comparing values of type Text with values of type

Does anyone know how to find the DAX error when you have formatted every single data table and combined data table to ensure there will be no format errors and there are no warning symbols on any files?  I hit the error when trying to add a new measure to a visual.  I am basically reproducing the same report I have already done but I need to change the number of reports so I started over and now I can't get any of the equations to work without the DAX format error.  Thanks