Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

remove delimiter if combinevalues empty

I have a large COMBINEVALUES doing combination of Ifs...but when there results all return false, it returns "" for the ifs, so the combinevalues resutls returns the delimiter only.  How do I not return the delimiter for empty values without repeating all the ifs over again?

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey Anonymous 

    It would help if you put the current DAX you are using.

    In general, you can wrap an IF statement arround your DAX.

    e.g.

    IF(YOUR_DAX = "YOUR_DELIMITER", BLANK(), YOUR_DAX)

     

    Good Luck!
    A

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yeah, the reason i didn't is because it's really long.

       

      It's basically Switch(condition, 

      IF statement,

      IF statement,

      IF statement,

      IF statement with combinevalues(", ", if statement, if statement, if statement, if statement, if statement, if statement)

      IF statement,

      IF statement,

      IF statement,

      IF statement,

      )

       

      If all those if statements inside combinevalues return as false (false condition returning ""), then combinevalues returns ",,,," as the result.  Which is correct, but I don't want those delimiters?  i want it to return "".  And I don't want to have to repaste the if statements and make it twice as long suddenly.