Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Pass selected slicer value(Text) into a measure

Hi,

 

*I'm using Report Server Desktop "RS".

I have a slicer that shows text values instead of numbers.  I would like to create a measure that takes the selected "text"value(Column A) in a slicer, filters Column B based on the selected value in Column A. Then returns a "count" or "distinct count" of the filtered rows. 

 

I tried building a measure but I'm returned with a message "Cannot convert value XXXX of type Text to type Number".

This seems like a simple formula but I'm not using the right syntax for DAX.

 

Heres a table example:

 

Column A-Slicer filters on this column

Dog
Cat

Mouse

Horse

Column B

PitBull

Corgi

Tabby Cat

Jack Russell

 

Thank you

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    The error message "Cannot convert value XXXX of type Text to type Number" suggests that there might be a mismatch in data types being compared or operated on in your DAX formula. This is a common issue when dealing with text and numeric data types, as DAX expects explicit data type alignment for operations.

     

    How would you like column A to be filtered and column B to be filtered? For example, if you select dog in slicer, will column B filter PitBull and Corgi? Is there another column that proves that PitBull and Corgi belong to dog?

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      Yes, if I select dog in slicer, column B will filter PitBull and Corgi. 

      Also Column A and B are apart of the same table.  I would like the measure to count the filtered column B and return a number count.