Forum Discussion

rdstone230's avatar
rdstone230
Regular Visitor
3 years ago
Solved

Modeling 2 columns to 1 column

Hi - I am extreamly novice to Power BI, but feel I have self taught myself well at least to this extent anyway.  I have one probelm area that I cannot overcome and that is with creating a reationship based on multiple columns.  I have two columns "Drv1" and Drv2" in one table called, C51F and "Drv1" and "Drv2" to another table called, Driver Name.  The table Driver Name also has a column called, "Driver Names".  I'm attemtping to relate Drv1 and Drv2 so that I can report the Driver Name for both Drv1 and Drv2.   

  • The best approach to simplify things would be to unpivot the Drv columns in one or both tables, so you can make a single relationship between the two tables.

     

    Pat

     

  • hi rdstone230 

    an intuitive way would be to create a new column in both tables with Drv1 and Drv2 in Power Query Editor or with DAX code like:

    Column = COMBINEVALUES("-", [Drv1], [Drv2])

     

3 Replies

  • hi rdstone230 

    an intuitive way would be to create a new column in both tables with Drv1 and Drv2 in Power Query Editor or with DAX code like:

    Column = COMBINEVALUES("-", [Drv1], [Drv2])

     

  • ppm1's avatar
    ppm1
    Solution Sage

    The best approach to simplify things would be to unpivot the Drv columns in one or both tables, so you can make a single relationship between the two tables.

     

    Pat