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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors