Forum Discussion

fgonzalez's avatar
fgonzalez
New Member
5 years ago
Solved

PROBLEMS WHEN CREATING A NEW TABLE

I am occupying Power BI Desktop and creating a new table.       Take DAX, "Union" and "AllSelected" functions from an existing data table. OC Tabla = (UNION                    (ALLSELECT...
  • v-kelly-msft's avatar
    v-kelly-msft
    5 years ago

    Hi  fgonzalez ,

     

    Using below dax expression instead:

    Table 2 =
    UNION (
        SELECTCOLUMNS (
            'Table',
            "obra", 'Table'[Obra],
            "Numero OC2", 'Table'[Numero OC2],
            "Proveedores", 'Table'[Proveedores],
            "Recurso", 'Table'[Recurso 1],
            "Unidad", 'Table'[Unidad 1],
            "Cant", 'Table'[Cant.1],
            "Precio", 'Table'[Precio1]
        ),
        SELECTCOLUMNS (
            'Table',
            "obra", 'Table'[Obra],
            "Numero OC2", 'Table'[Numero OC2],
            "Proveedores", 'Table'[Proveedores],
            "Recurso", 'Table'[Recurso 2],
            "Unidad", 'Table'[Unidad 2],
            "Cant", 'Table'[Cant.2],
            "Precio", 'Table'[Precio 2]
        )
    )
    

    And you will see:

    For my sample .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!