Forum Discussion
Anonymous
5 years agoNot applicable
Left 2 characters from column - Direct Query
Hi there, I'm using Direct Query and want to create a slicer / report based on the left 2 characters of a column. Example source table: Code Claim AZ12 X AB123 X1 ...
- 5 years ago
Anonymous , if it is a new column simply use
LEFT('Table'[Column],2)
Anonymous
5 years agoNot applicable
Hi Anonymous ,
According to the official document, HASONEVALUE() returns TRUE when the context for columnName has been filtered down to one distinct value only. Otherwise is FALSE.
In addition, calculated columns could not be dynamic that means values won't change according to the user selection. So It's not appropriate to use HASONEVALUE().
Please take a look at the below screenshot to understand the difference between Column and Measure.
In summary, as amitchandak suggest , please just use LEFT() function directly.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.