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
NikitaDalela
Helper II
Helper II

Remove rows from data

Hi Folks,

I have exported data from excel, PFB sample dataset.

ColAColBColC
aabb23
ccdd43
eeff30
 Total96
gghh10
iijj35
kkll20
 Total65

 

Now, I need to remove rows having Totals. So my data after transformation should look like below.

ColAColBColC
aabb23
ccdd43
eeff30
gghh10
iijj35
kkll20

 

Can someone please advise on how to achieve the same?

 

 

Thanks & Regards,

Nikita Dalela | BI Consultant

Nice Software Solutions

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @NikitaDalela ,

 

We can use two ways to meet your requirement. One is in Power Query Editor, another is to create a calculate table.

 

1. In Power Query Editor, we can create a conditional column. The “Total” is 0, others are 1.

 

remove1.jpg

 

remove2.jpg

 

remove3.jpg

 

2. Then we filter out the value of 0 in custom column.

 

remove4.jpg

 

3. At last we delete the custom column, the result like this,

 

remove5.jpg

 

Or we can create a calculate table using DAX.

 

Table 2 = SUMMARIZE(FILTER('Table (2)','Table (2)'[ColB]<>"Total"),'Table (2)'[ColA],'Table (2)'[ColB],'Table (2)'[ColC])

 

remove6.jpg 

 

If them don’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

8 REPLIES 8
v-zhenbw-msft
Community Support
Community Support

Hi @NikitaDalela ,

 

We can use two ways to meet your requirement. One is in Power Query Editor, another is to create a calculate table.

 

1. In Power Query Editor, we can create a conditional column. The “Total” is 0, others are 1.

 

remove1.jpg

 

remove2.jpg

 

remove3.jpg

 

2. Then we filter out the value of 0 in custom column.

 

remove4.jpg

 

3. At last we delete the custom column, the result like this,

 

remove5.jpg

 

Or we can create a calculate table using DAX.

 

Table 2 = SUMMARIZE(FILTER('Table (2)','Table (2)'[ColB]<>"Total"),'Table (2)'[ColA],'Table (2)'[ColB],'Table (2)'[ColC])

 

remove6.jpg 

 

If them don’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

Thanks @v-zhenbw-msft ! This worked fine 👍

sturlaws
Resident Rockstar
Resident Rockstar

Hi @NikitaDalela 

 

if you open up power query from the 'Transform data'-button:

 



If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

Cheers,
Sturla

Hi @sturlaws ,

I am aware of "Remove Rows" in Power Query Editor, however there is no option to remove selected rows or specific rows. My data is huge and has multiple rows containing "Total".

ROWS.JPG

Kindly let me know if I am missing something here.

 

 

Thanks & Regards,

Nikita Dalela | BI Consultant

Nice Software Solutions

sorry, obviously did not manage to include a screenshot:

image.png

works!!! thanks man!!

I had earlier tried using this workaround @sturlaws, but, this wouldn't work since the column where"Total" appears could be text/date/location and due to presence of "Total" in its values, I am unable to change the datatye of these columns to date. It will always consider it as a text unless we remove the rows containg total.

Your original post did not include that piece of pertinent information 😀

 

So I altered your sample data a little:
image.png

 

If you click on the Source-step you get the original table. Now filter out the 'Total'-rows and you get this:
image.png

 

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.