Forum Discussion

satishkoneri's avatar
satishkoneri
Frequent Visitor
6 years ago
Solved

Headers and Values from multiple tables using DAX

Hi,

 

I'm new to Power BI. I have 3 tables as Customer, Part and Order.

 

I would like to get unique values from these 3 tables for selected columns as an output into another table with 2 columns - AttributeName and AttributeValue (Screenshot below with sample data and output required). 

 

Please can you advise if this can be achieved by DAX (Modelling -> Calculations -> NewTable) ?

 

 
  • Hi satishkoneri 

     

    Sure you can write an expression like below, nevertheless, it would be better to do it in Power Query Editor.

    Table = 
        UNION(
            CROSSJOIN(
                {"Cust_Name"},
                VALUES( 'Table 1'[Cust_Name] )
            ),
            CROSSJOIN(
                {"Part_Name"},
                VALUES( 'Table 2'[Part_Name] )
            ),
            CROSSJOIN(
                {"Order_Type"},
                VALUES( 'Table 3'[Order_Type] )
            )
        )
    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

1 Reply

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi satishkoneri 

     

    Sure you can write an expression like below, nevertheless, it would be better to do it in Power Query Editor.

    Table = 
        UNION(
            CROSSJOIN(
                {"Cust_Name"},
                VALUES( 'Table 1'[Cust_Name] )
            ),
            CROSSJOIN(
                {"Part_Name"},
                VALUES( 'Table 2'[Part_Name] )
            ),
            CROSSJOIN(
                {"Order_Type"},
                VALUES( 'Table 3'[Order_Type] )
            )
        )
    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn