cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bsheffer
Resolver I
Resolver I

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

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





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

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

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





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

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

Pragati11
Super User III
Super User III

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





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




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.

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

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.