Forum Discussion
keondopark
10 years agoRegular Visitor
How can I make string values to appear on pivot table?
Hi, I am now trying to make the date records into table format.
But the data column contains both numeric and string values
For example, if you have a dataset as below,
Key RowID ColID Data...
Greg_Deckler
10 years agoCommunity Champion
I'm not sure how you are doing that with a Matrix visualization honestly, if you try to use a Text field in the Value for a Matrix, it tends to want to count it versus giving you the text.
greggyb
10 years agoResident Rockstar
A measure can return a text datatype. If you can write a measure that evaluates to a single text value appropriately, it should work in a matrix.
- keondopark10 years agoRegular Visitor
Can you explain in detail??
- greggyb10 years agoResident Rockstar
Make a measure, and instead of evaluating arithmetic, evaluate a string:
// DAX // All below are measures in my model MyMeasureReturnsText! = "This measure returns text" This Measure returns text based on a field value! = CONCATENATEX( VALUES( 'Sample'[SomeField] ) ,SWITCH( 'Sample'[SomeField] ,1, "That's a one" ,2, "Well that looks like a 2" ,3, "By golly, thats a seventeen!" ) )
My 'Sample' is just a 3-row table with values of [SomeField] = 1, 2, 3.
You can see that my matrix uses [SomeField] as the row labels. My measures are both in the Values area. Each returns text.
I'm happy to help more, but I don't know what sort of detail you're looking for.