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
Anonymous
Not applicable

Power Query to filter

Hello Community,

My data source is in Excel and “Price Check” column data type is decimal in power bi.

I want to filter “Not Valid”=0 or Blank in Power Query.I have tried TEXT.CONTAINTS but not able to get correct result due to data type.

Can any one has any suggestion?

ROW DATA
Price Check
122.63
25.96
 
Not Valid
36.88
77.96

 

FINAL RESULT
Price Check
122.63
25.96
0 or Blank
36.88
77.96
1 ACCEPTED SOLUTION

Hi @Anonymous 

If there is an error in your original example, please replace error with 0 or blank.

Capture5.JPGCapture6.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
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

7 REPLIES 7
Anonymous
Not applicable

Hi,

 

What you can do is, add a new column

 

new column = IF(  OR( [price Check] = 0 , [price Check] = BLANK() ), 0, 1)

 

So in this new column, it gives 0 to 0 and blank, and gives 1 to the rest. You can filter this column instead of the original one. 

Anonymous
Not applicable

Hi Tatasherrry,

Thank you so much for your suggestion.

My table has multiple column and "Price Check" is one of the column,In calculation i am also using other column so it is not possbile for me to remove the row with "Not Valid" comments.

let me know if you need more information.

 

Anonymous
Not applicable

Okay, I understand this time.

 

What you need to do is quite easy:

 

Go to "Edit queries", right click the column header, choose "replace", replace "Not Valid" to 0 or leave it blank.

Anonymous
Not applicable

Column data type is decimal and power bi not accepting value to find as a text.I have tried to change the data type to text and
use the replace value but not working .

replacepowerbi.jpg

Anonymous
Not applicable

When you try to change the data type but it shows you an error,

it means you have to go to "Edit Queries", then "transform", then "data type : text".

 

Let me know if it is works 🙂

Anonymous
Not applicable

Hi Tatasherry,

Thank so much for your suggestion.Still i am getting an error.I found the other workaround and it is working fine for me.

Thanks

Hi @Anonymous 

If there is an error in your original example, please replace error with 0 or blank.

Capture5.JPGCapture6.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.