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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to count rows where length of field is not 11?

Hi all

I am trying to count rows of a table (Vendors) where field (Vendor ID) length is NOT 11. I have tried the below but am getting an error:

 

 

AVendIDNoComp =
VAR a =
    CALCULATE (
        COUNTROWS ( Vendor ),
        FILTER ( Vendor, LEN ( Vendor[Vendor ID] <> 11 ) )
    )
RETURN
    a

 

The error I am getting is:

 

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

 

The Vendor ID is a text field, and contains alphanumeric characters. Any advice on how I can go about resolving this issue?

Example data contained in the field would be:

 

V01234/US

V83627/UK36

V93756/ES

 

So with the above example data I would return a count of 2 using this measure. Just to add, this is a live connection to a PBI dataset, and I have no access to amend the data model/edit query.

Many thanks for all help

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,

You just have a typo - no closing parenthesis after LEN ( Vendor[Vendor ID]...

Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I am having a bad day!

Jos_Woolley
Solution Sage
Solution Sage

Hi,

You just have a typo - no closing parenthesis after LEN ( Vendor[Vendor ID]...

Regards

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.