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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Column Data Type is Text but ISTEXT measure says otherwise

Hi,

 

I'm connected to a Published Dataset and creating a dashboard with it on the Desktop application. I have a calculated measure referencing the Item Number column that needs to use either FIND or SEARCH to determine location of a Hyphen '-'. It is working half the time and not the other half. I couldn't figure out why it could find the hyphen in something like '007-2832L' and then would not work on something like '11WST-038'. I finally just added a measure ISTEXT(itemnumber) to see what it would say, and sure enough the rows it wasn't working on said FALSE and TRUE on the rows that the formulas were working on. I don't know how to correct this as my system admin has the column data type set correctly to TEXT. I tried using CONVERT to force it into TEXT, that didn't work. Out of curiousity I downloaded the .pbix of the dataset, made a table of just itemnumber and a measure ISTEXT(itemnumber), and nothing came back FALSE. Very confused at this point. I've refreshed my file, closed and re-opened. Nothing seems to correct it.  Would very much appreciate any help. 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

I can get the correct result when create a measure using the same formula with yours just as shown in below screenshot. The precondition is the field ItemNumber need to be put on the related visual...

Include hypen = 
VAR hyphen = "-"
VAR itemstr =
    SELECTEDVALUE ( 'Table'[ItemNumber] )
VAR firsthyphen =
    IFERROR ( FIND ( hyphen, itemstr, 1, 0 ), 0 )
RETURN
    IF ( firsthyphen > 0, "Yes", "No" )

yingyinr_0-1627371232392.png

Best Regards

Community Support Team _ Rena
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-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I just created a calculated column as below to check whether the item number include the hyphen "-", it can return the correct result just as shown in below screenshot. And it can get the correct values if I use ISTEXT fuction to check whether the value of item number is Text. Could you please provide the related formula of your calculated measure which using FIND or Search function? Thank you.

Is include hyphen = IF ( SEARCH ( "-", 'Table'[ItemNumber], 1, 0 ), "Yes", "No" )

yingyinr_1-1627268034802.png

Best Regards

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

I cannot make a calculated column, I am connected to published dataset so column creation is restricted. My measure formulas:

'= ISTEXT(SELECTEDVALUE('Table'[ItemNumber]))'

To find hyphen:

'Var hyphen = "-"

Var itemstr = SELECTEDVALUE('Table'[ItemNumber])

Var firsthyphen = FIND(hyphen, itemstr,1,0)'

 

I found a common theme though - there is a sum of inventory column, when I put that quantity field into the table, all my FALSE values are tied to those items where the Sum of Inventory was zero, so as a bandaid I can use that to sort out. 

Hi @Anonymous ,

I can get the correct result when create a measure using the same formula with yours just as shown in below screenshot. The precondition is the field ItemNumber need to be put on the related visual...

Include hypen = 
VAR hyphen = "-"
VAR itemstr =
    SELECTEDVALUE ( 'Table'[ItemNumber] )
VAR firsthyphen =
    IFERROR ( FIND ( hyphen, itemstr, 1, 0 ), 0 )
RETURN
    IF ( firsthyphen > 0, "Yes", "No" )

yingyinr_0-1627371232392.png

Best Regards

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

161462cc_0-1627043521223.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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