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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rpinxt
Solution Sage
Solution Sage

Add a line Other to table with 2 columns

I have this code that adds a row "Others" to 1 column of a table:

PF+Oth =
FILTER(
UNION (
ALLNOBLANKROW( PF[Prod.Fam.] ),
{ "Others" } ),
NOT ISBLANK( [Prod.Fam.] )
)
 
However this table has 2 columns. Now I would like that table with 2 columns and Others to both columns.
How would I change this code?
Just adding another line with ALLNOBLANKROW for the 2nd column is not working.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rpinxt ,

 

UNION function only support us to combine tables with same number of columns. According to your screenshot. "PF" table has two columns. {"Others"} only has one column. Now you want to add Other in two columns, so I suggest you to create a table with two columns.

PF+Oth = 
FILTER (
    UNION (
        ALLNOBLANKROW ( PF ),
        ROW ( "Prod.Fam.", "Others", "Prod.Fam.Lv2", "Others" )
    ),
    AND ( NOT ISBLANK ( PF[Prod.Fam.] ), NOT ISBLANK ( PF[Prod.Fam.Lv2] ) )
)

Result is as below.

RicoZhou_0-1652258304314.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
rpinxt
Solution Sage
Solution Sage

@amitchandak 
Not sure how I can make it clearer but this is the table:

rpinxt_0-1651656224135.png

 

Now I have this :

rpinxt_1-1651656262179.png

This had a line with Others. But only in column Prod.Fam.

 

What I would need is also the column Prod.Fam.Lv2 with a line Others in this table.

Anonymous
Not applicable

Hi @rpinxt ,

 

UNION function only support us to combine tables with same number of columns. According to your screenshot. "PF" table has two columns. {"Others"} only has one column. Now you want to add Other in two columns, so I suggest you to create a table with two columns.

PF+Oth = 
FILTER (
    UNION (
        ALLNOBLANKROW ( PF ),
        ROW ( "Prod.Fam.", "Others", "Prod.Fam.Lv2", "Others" )
    ),
    AND ( NOT ISBLANK ( PF[Prod.Fam.] ), NOT ISBLANK ( PF[Prod.Fam.Lv2] ) )
)

Result is as below.

RicoZhou_0-1652258304314.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@rpinxt , Now very clear, but row can help

example of two columns with value

ROW("ProductCode_wOthers", 99, "Item_wOthers", "Others")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors