How to use DAX to return just one string value

Tags: Power BI, DAX, one, value, HASONEVALUE

Let’s say for a second you have a Table called TableName and the text you want to display is in a column called TextColumn. Sound like a math problem, well it isn’t; just basic DAX filtering. So the measure you’d write to get a single line of text, is below. This is useful if you want to show text only if just one value is selected on the report page.

Measure = if(HASONEVALUE(TableName[TextColumn]), VALUES(TableName[TextColumn]), "")

No Comments

You must log on to comment.