Forum Discussion

dofrancis3's avatar
dofrancis3
Icon for Resolver I rankResolver I
1 year ago
Solved

Unpivoted table withput powerpivot

Dear colleagues,

As you would see in the screenshot below, from table_1 il would like to create Unpivot DAX table without using Power Query.

Please could you support to resolve this issues.

 

 

Thank you.

 

Fd.

  • dofrancis3 , Try using SELECT COLUMNS and UNION

     

    dax
    Table_2 =
    UNION(
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "An approved activity",
    "Indicators", Table_1[An approved activity],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "What is the intended use of these tools",
    "Indicators", Table_1[What is the intended use of these tools],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "Capacity building",
    "Indicators", Table_1[Capacity building],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "Verry good",
    "Indicators", Table_1[Verry good],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "Have any surveys",
    "Indicators", Table_1[Have any surveys],
    "Value", BLANK()
    )
    )

1 Reply

  • dofrancis3 , Try using SELECT COLUMNS and UNION

     

    dax
    Table_2 =
    UNION(
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "An approved activity",
    "Indicators", Table_1[An approved activity],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "What is the intended use of these tools",
    "Indicators", Table_1[What is the intended use of these tools],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "Capacity building",
    "Indicators", Table_1[Capacity building],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "Verry good",
    "Indicators", Table_1[Verry good],
    "Value", BLANK()
    ),
    SELECTCOLUMNS(
    Table_1,
    "Country", Table_1[Country],
    "Year", Table_1[Year],
    "Quarter", Table_1[Quarter],
    "Output", "Have any surveys",
    "Indicators", Table_1[Have any surveys],
    "Value", BLANK()
    )
    )