Forum Discussion

PBIUWO's avatar
PBIUWO
Helper III
5 years ago
Solved

How can I create 1 column by appending multiple column values, and also add a date field?

Hi,   I have a SUMMARIZE Table (with column names) that looks like this.  *summarize because the data has multiple tables, and so i had to use a DAX formula for it.    Customer Account |  Value ...
  • v-luwang-msft's avatar
    5 years ago

    Hi PBIUWO ,

    You could try like following:

    base data:

     

    then create a new table by the following measure:

    Table 2 =
    UNION (
        SELECTCOLUMNS (
            'Table',
            "Customer Account", 'Table'[Customer Account],
            "Year Returned", "2019",
            "Value Returned", 'Table'[Value Returned 2019]
        ),
        SELECTCOLUMNS (
            'Table',
            "Customer Account", 'Table'[Customer Account],
            "Year Returned", "2020",
            "Value Returned", 'Table'[Value Returned 2020]
        ),
        SELECTCOLUMNS (
            'Table',
            "Customer Account", 'Table'[Customer Account],
            "Year Returned", "2021",
            "Value Returned", 'Table'[Value Returned 2021]
        )
    )

    And final you will get :

     

     

     

    Wish it is helpful for you!

     

     

    Best Regards

    Lucien