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
selpaqm
Helper V
Helper V

removing rows with blank value on multiple columns

Hi,

 

ı have an huge table and I want to simplify it with removing blank rows. I have tried power query add custom column and conditional column methods and cannot succeed.

source file is csv on sharepoint and 3 column (want to remove blank on those) is text type

for an example;

iduniquesalesmancountrycustomer
1123aaagbada
22345   
30938  awe
4235 tr 
5545ccc  

 

as a result I want to remove rows that salesman and country and customer sections are empty in the same time. 

in this example 2nd row need to be removed. 

add custome column formula "=IF [Salesman] = "" and [country] ="" and [customer] ="" then 0 else 1 " not worked

"=IF [Salesman] = "" then 0 else if [country] ="" then 0 else if [customer] ="" then 0 else 1" not worked.

 

thanks

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@selpaqm 

In Power Query, Select All three Columns (salesman,country ,customer). 
On the Add Column Tab, Click Merge Column,
In your new Column, Filter out blank,

You get the desired results

 

 


You can delete the merged column

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@selpaqm 

In Power Query, Select All three Columns (salesman,country ,customer). 
On the Add Column Tab, Click Merge Column,
In your new Column, Filter out blank,

You get the desired results

 

 


You can delete the merged column

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

When the dataset is reloaded with new data, would the filter then include new values that was not in the table before (will it still only exclude blank values)? Does any one know?

After clicking the conditions on the step, it seams indeed that it does only exclude the blanks (meaning it will include new values that will appear when reloading data later on). Great 🙂 :

ArthurKvalheim_0-1662028064829.png

 



thanks @Fowmy  . what a shame for me to not think about merge those cells.

 

Regards,

Pragati11
Super User
Super User

HI @selpaqm ,

 

I am assuming you have got blank values in all of the mentioned columns in source data and they have TEXT data-type.

 

Create a column as below using DAX expression:

IfBlankValue = IF ([Salesman] = BLANK() && [country] = BLANK() && [customer] = BLANK(), 0, 1)

 

Create a visual like the table you have shared in your screenshot. On this table visual, move IfBlankValue as a visual level filter and select value IfBlankValue = 1

 

Let me know if this approach works.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.