cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BBIUser Helper IV
Helper IV

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 III
Super User III

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 ) ) )
Try my new Power BI game Cross the River

View solution in original post

Microsoft
Microsoft

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.

View solution in original post

8 REPLIES 8
Moscuba Resolver I
Resolver I

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 Helper IV
Helper IV

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 III
Super User III

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 ) ) )
Try my new Power BI game Cross the River

View solution in original post

Microsoft
Microsoft

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.

View solution in original post

BBIUser Helper IV
Helper IV

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.

Highlighted
digirla
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

kbuckvol
Frequent Visitor

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

Did you figure this out?  I am running into the same issue. All my look up values are text but I'm getting and error message about mixed types.

digirla
New Member

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

I had a sum on one of my measures that after I changed it not to summarize I did not get this error anymore.  That probably doesn't help.  I also had the same sum in a prior version and I didn't get this error so I am not sure what exactly fixed it.  I did have a mix of numbers and text, I checked every single table again to see if I could find one that had multiple formats and there were none. 

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors