Forum Discussion

Chitemerere's avatar
Chitemerere
Icon for Responsive Resident rankResponsive Resident
6 years ago

New table creation with UNION

I am trying to create a new table using UNION based on an exisiting table called 'PharmaAuditGW" as follows:

 

Original table called PharmaAuditGW

 

 

 

PharmaAuditGW with Others = UNION(
ROW("ProductCode_wOthers", 99, "Item_wOthers", "Others"),
ALLNOBLANKROW('PharmaAuditGW'[ProductCode], 'PharmaAuditGW'[Item])
)
 
However the results are reversed as can be seen below:
 

 

The column headers are exchanged together with the values of the newly created row.
 
Kindly assist,
Chris

6 Replies

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

    Hi Chitemerere 

    try to use the same column names and order, like

    PharmaAuditGW with Others = UNION(
    ROW("ProductCode", 99, "Item", "Others"),
    ALLNOBLANKROW('PharmaAuditGW'[ProductCode], 'PharmaAuditGW'[Item])
    )
    • Chitemerere's avatar
      Chitemerere
      Icon for Responsive Resident rankResponsive Resident

      Thank you very much for your response, most appreciated.  The results are as follows:

       

       

      The problem still exists.

       

      Regards,

      Chris

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        @Chitemerere ,

        Try it once like this and see if it works

        PharmaAuditGW with others - UNION(
        ROW("ProductCode_wOthers", 99, "Item_wOthers", "Other"),
        summary('PharmaAuditGW','PharmaAuditGW'[ProductCode], 'PharmaAuditGW'[Item])
        )

        you can filter from white in summary

    • Chitemerere's avatar
      Chitemerere
      Icon for Responsive Resident rankResponsive Resident

      Thank you very much for your input, the solution did not work, see below:

       

       

      Best regards,

      Chris