Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Contains Text Measure to create new column

Hi, how do I create a measure where column contains a few text strings then adds the value of the text to a new column ,(like add column, conditional formatting in query editor), but I need a measure to it calculates automatically on refresh of data. Thanks Andy.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    2. create a column with below dax formula

    Column =
    VAR _a =
        INT ( [Column1] )
    VAR _result =
        IF ( ISERROR ( _a ), [Column1], BLANK () )
    RETURN
        _result
    

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • I'd do this with Power Query instead of with DAX using a conditional column to evaluate if Text.Contains and if that's the case the value will be that string. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please try below steps:

    1. below is my test table

    Table:

    2. create a column with below dax formula

    Column =
    VAR _a =
        INT ( [Column1] )
    VAR _result =
        IF ( ISERROR ( _a ), [Column1], BLANK () )
    RETURN
        _result
    

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.