Power BI: display value on criteria with a measure

It is quite simple to display value by using filters so this article is not about that but about how to do it using a DAX formula using a measure. I will use this example:

power bi

The goal is to display values of the “number” column based on the criteria “type”, “category” or both. The formula with 1 criteria:

CONCATENATEX(FILTER('table','table'[argument1]="criteria"),'table'[argument2],", ")

NOTE: instead to separate the value with a coma, just replace “,” by whatever you want.

power bi

For my example, it shows all “number” according to the “type” = “yes”. The result:

power bi

The formula with 2 criterias or more:

CONCATENATEX(FILTER('table',
'table'[argument1]="criteria1"
&&'table'[argument2]="criteria2"),
'table'[argument3],", ")

NOTE: to add another criteria, just add “&&'table'[argument]="criteria")” below the line of “criteria1”.

power bi

For my example, it shows all “number” according to the “type” = “yes” and “category” = “a”. The result:

power bi

And to end, the formula combining “and” (&&) and “or” (||) conditions:

CONCATENATEX(FILTER('table',
'table'[argument1]="criteria1"
&&('table'[argument2]="criteria2"||'table'[argument2]="criteria3")),
'table'[argument3],", ")

Interesting Management