Forum Discussion

ArielK's avatar
ArielK
Frequent Visitor
2 years ago
Solved

Filter on Concatenatex function

Dear Experts   I am beginner DAX user and I am trying to create filter that combine data from two columns containing names. source data looks something like this:   Name1 Name2 A ...
  • johnyip's avatar
    2 years ago

    I assume you use this DAX for the calculated column.

     

     

    CONCATENATEX('Table',[Name1] & [Name2], " ")

     

     

    But instead, you should use the following.

     

    Column = IF([Name1]<[Name2], [Name1] & [Name2], [Name2] & [Name1])

     

     

    If you wish to use a measure instead, use the following:

    Measure = IF(MAX([Name1])<MAX([Name2]), MAX([Name1]) & MAX([Name2]), MAX([Name2]) & MAX([Name1]))

     

     

     

     

  • johnyip's avatar
    johnyip
    2 years ago

    ArielK 

    For measure, there is row context.

    Measures are evaluated row by row, depending on the visuals.

    If you are using a table, the current "row" will be showing one value,

    so MAX() of that value of the "row" will always be that exact one value.

     

    And please accept my asnwer a the solution so others with the same problem can look for this thread.

    You can also use MIN(), AVERAGE(), etc. But by the time I was learning and/or asking, I found most people use MAX().