Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create DAX/ Power Query column from a column with different items

I want to create a column from another column. The column has Numerical values and Text Values hence can only be stored in text values. The column is as follows and the column next to it is my ask.  ...
  • v-yinliw-msft's avatar
    v-yinliw-msft
    3 years ago

    Hi Anonymous ,

     

    You can try this method:

    New a column:

    Desired Column =
    IF (
        MID ( 'Table'[Item Code ], 1, 3 ) = "100",
        "Item",
        IF ( MID ( 'Table'[Item Code ], 1, 3 ) = "600", "Parts", "Labour" )
    )
    

    The result is:

     

    Hope this helps you.

    Here is my PBIX file.

     

    Best Regards,

    Community Support Team _Yinliw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.