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
zoaph
Frequent Visitor

Merge 2 rows in same column into 1 row

Hello everyone

 

I'm currently stuck in a situation.. I have a table column called 'Accounts', it has 5 different categories. But 2 of it is the same, just separated. Now what I want to do is to combine those two categories into 1 category. Basically, Service + AnotherService = Service. Because I need to get their total sales. So in the visualization, it'll display 4 categories instead of 5.

 

1.PNG

 

Can anyone suggest how I go about doing it? Thank you! Smiley Happy

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@zoaph

 

One of the ways could be to add a calculated column

 

New Accounts Column =
IF (
    SEARCH ( "Service", Table1[Accounts], 1, 0 ) > 0,
    "Service",
    Table1[Accounts]
)

 

 


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@zoaph

 

One of the ways could be to add a calculated column

 

New Accounts Column =
IF (
    SEARCH ( "Service", Table1[Accounts], 1, 0 ) > 0,
    "Service",
    Table1[Accounts]
)

 

 


Regards
Zubair

Please try my custom visuals

EDIT: His solution was exactly what I wanted. THANK YOU!

But I made one small adjustment. I changed the first "Service" into "AnotherService" so that every "AnotherService" would be changed to "Service".

New Accounts Column =
IF (
    SEARCH ( "AnotherService", Table1[Accounts], 1, 0 ) > 0,
    "Service",
    Table1[Accounts]
)

---

Hi @Zubair_Muhammad, currently in my visualisation, it is looking like this:

 

Capture.PNG

 

What I want is like this:

2.PNG

 

 

The AnotherService is a separate category with a different name than Service. If I did the calculated column, wouldn't it only search for Service and miss out on AnotherService?

 

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.