Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Chitemerere
Responsive Resident
Responsive Resident

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

 

Table_Original.JPG

 

 

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:
 
UNION_TABLE_Creation.JPG

 

The column headers are exchanged together with the values of the newly created row.
 
Kindly assist,
Chris
6 REPLIES 6
az38
Community Champion
Community 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])
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Chitemerere
Responsive Resident
Responsive Resident

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

 

NonworkingOthers.JPG

 

Best regards,

Chris

Chitemerere
Responsive Resident
Responsive Resident

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

 

AUDIT_WITH_OTHERS.JPG

 

The problem still exists.

 

Regards,

Chris

@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

Many thanks, that worked.

 

Regards,

Chris

@Chitemerere did you try putting the 99 in quotes? "99"? Maybe try switching the order of the second table? That's kind of interesting behavior!

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.