Forum Discussion

RahulPBI's avatar
RahulPBI
Helper I
6 years ago
Solved

Concatenate Text with Week Number column

Hi Experts I am trying to concatenate text with the a week number column but I am getting an error. I've tried two diffrent options and none work = &"CONCATENATE("WK-",Calendar[Week]) = &"WK-"&[We...
  • AlB's avatar
    6 years ago

    Hi RahulPBI 

    Is what you are showing the code for a custom column in the query editor?? If so, your second option is close:

        = "WK-"&[Week]

    assuming of course that "Week" is the name of the column you already have and it has the week number

    If this is not it share a sample of your data. This is very important to get you question answered

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

  • AlB's avatar
    AlB
    6 years ago

    RahulPBI 

    Just update the last step. The error message is saying quite clearly what the problem is: "We cannot apply operator & to types Text and Number" [Week] is of type numer so you have to convert it to text before applying the & operator:

     

     #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Week1", each "WK-"& Text.From( [Week] ) )

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers