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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
dtango9
Helper II
Helper II

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

Hello,


I'm wondering why this formula isn't working and how to correct it - this is the error message I'm getting:  "DAX comparison operations do not support comparing values of type Text with values of type Integer.  Consider using the VALUE or FORMAT function to convert one of the values.  Any help is greatly appreciated! 🙂

Connects = CALCULATE(COUNT('phonecalls'[actualend]),FILTER('phonecalls','phonecalls'[Acct Number]='new_product'[Account Number] && 'phonecalls'[actualend]>='new_product'[new_startdate] && 'phonecalls'[actualend]<='new_product'[new_enddate])) + CALCULATE(COUNT('Annotations'[createdon]),FILTER(Annotations,'Annotations'[Acccount #] ='new_product'[Account Number] && 'Annotations'[createdon]>='new_product'[new_startdate] && 'Annotations'[createdon]<='new_product'[new_enddate].[Date]))
1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@dtango9 

 

Check the data types of the filtered columns, for example 'phonecalls'[Acct Number]='new_product'[Account Number] both columns should be the same data type usually Whole number. Also, for [actualend], [new_startdate], [new_enddate]), [createdon], sometimes dates can displayed in numerical form (20200101) or Text form(01 Jan 2020), usually we need to change them to Date or Date/Time format. 

 

You used Format() to change datatype or just change the datetype on Desktop menu.

format.JPG

 

Paul Zheng _ Community Support Team
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

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@dtango9 

 

Check the data types of the filtered columns, for example 'phonecalls'[Acct Number]='new_product'[Account Number] both columns should be the same data type usually Whole number. Also, for [actualend], [new_startdate], [new_enddate]), [createdon], sometimes dates can displayed in numerical form (20200101) or Text form(01 Jan 2020), usually we need to change them to Date or Date/Time format. 

 

You used Format() to change datatype or just change the datetype on Desktop menu.

format.JPG

 

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

 

 

 

Hi,

 

I am also facing same issue and I tried with above solution but its not working. Any help greatly appreaceated!
"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."

Mileage = IF(CALCULATE(FIRSTNONBLANK('Requested_VIN List'[Mileage],1),FILTER(ALL('Requested_VIN List'),'Requested_VIN List'[VIN]='Fleet Ref_VIN_List'[VIN]))="","-",CALCULATE(FIRSTNONBLANK('Requested_VIN List'[Mileage],1),FILTER(ALL('Requested_VIN List'),'Requested_VIN List'[VIN] ='Fleet Ref_VIN_List'[VIN])))

 

Thank you so much!  Formatting was the issue 🙂

nandukrishnavs
Super User
Super User

@dtango9 
I have modified your measure

Connects =
VAR _new_startdate =
    SELECTEDVALUE ( 'new_product'[new_startdate] )
VAR _new_enddate =
    SELECTEDVALUE ( 'new_product'[new_enddate] )
VAR _Phonecalls =
    CALCULATE (
        COUNT ( 'phonecalls'[actualend] ),
        FILTER (
            'phonecalls',
            'phonecalls'[Acct Number] = 'new_product'[Account Number]
                && 'phonecalls'[actualend] >= _new_startdate
                && 'phonecalls'[actualend] <= _new_enddate
        )
    )
VAR _Annotation =
    CALCULATE (
        COUNT ( 'Annotations'[createdon] ),
        FILTER (
            Annotations,
            'Annotations'[Acccount #] = 'new_product'[Account Number]
                && 'Annotations'[createdon] >= _new_startdate
                && 'Annotations'[createdon] <= _new_enddate
        )
    )
VAR result = _Phonecalls + _Annotation
RETURN
    result

Try this. If it is not working, use the table visual then return the variables one by one and identify which module is creating an issue.

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.