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
Returnofthemack
Frequent Visitor

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 2
v-rongtiep-msft
Community Support
Community Support

Hi @Returnofthemack ,

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.

 

 

 

 

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. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors