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
bsheffer
Continued Contributor
Continued Contributor

measure in visual filter wanting number not text

I have a measure that returns text from a table which is overloaded so each name field contains a different data element and the value field contains a string.  Some of these strings are numeric but are stored as strings due to the mixed use.  So my measure is:

 

_acritem_Equipment_description =
calculate(
     FIRSTNONBLANK('Fact ACRITEM'[VALUE], 'Fact ACRITEM'[VALUE]),
     filter(
          'Fact ACRITEM',
          CONTAINSSTRING('Fact ACRITEM'[NAME], "Equipment") && CONTAINSSTRING('Fact ACRITEM'[NAME], "description")
     )
)
 
the table visual I put it in has the list of text values I expected.  But when I go to the filter pane and try to filter on these values, it just gives me numeric options or not blank.  Why isn't it giving the normal options of IS, CONTAINS, etc.?
2 ACCEPTED SOLUTIONS
Pragati11
Super User
Super User

Hi @bsheffer ,

 

Can you share the screesnshot for what is the data-type for this MODEL TYPE column?

 

I tried something similar at my end and it works fine:

Pragati11_0-1608226023731.png

 Can you try removing other filters and see if it works? I have a feeling that the already applied filters are doing something there.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

bsheffer
Continued Contributor
Continued Contributor

I didn't notice that measures default to decimal data type.  Once I changed the measure to text it worked fine.  Thanks for pointing me at the right place.

View solution in original post

5 REPLIES 5
Pragati11
Super User
Super User

Hi @bsheffer ,

 

Can you share the screesnshot for what is the data-type for this MODEL TYPE column?

 

I tried something similar at my end and it works fine:

Pragati11_0-1608226023731.png

 Can you try removing other filters and see if it works? I have a feeling that the already applied filters are doing something there.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

bsheffer
Continued Contributor
Continued Contributor

I didn't notice that measures default to decimal data type.  Once I changed the measure to text it worked fine.  Thanks for pointing me at the right place.

Pragati11
Super User
Super User

Hi @bsheffer ,

 

Can you please add some screesnhots on your issue specially the numeric options thing?

This is not making your issue clear.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

bsheffer
Continued Contributor
Continued Contributor

filter_treats_measure_as_number.png

so you can see that the Model Type has text values but in the filter pane it is giving me an error when I type in a string.  If I type in a number it doesn't give an error but also doesn't give the desired result.  Also notice the autoformating of the field is right justified as if the column value was a number.

bsheffer
Continued Contributor
Continued Contributor

in case it wasn't clear:  Equipment Description = Model Type

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.