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

Filter table buy row talue

Hi guy

I have a data like this

year part cust
2010 100 10
2010 200 15
2005 100 10
2006 150 15
2007 200 10
2008 150 15
2009 100 15

i have loaded the excel table , Now I want to filter this table to have only rows  , with the year  2007 and  up

how can I do it  ?

( I don not see a way to up load files as examples , is it possible to add power bi files and excel file )

thanks)

gidon

 

 

2 ACCEPTED SOLUTIONS
Vvelarde
Community Champion
Community Champion

@gidon after apllied the filter you can change the M Sentence.

 

change to look like this:

 

= Table.SelectRows(#"Changed Type", each [year] >= Date.Year(DateTime.LocalNow())-4)




Lima - Peru

View solution in original post

Vvelarde
Community Champion
Community Champion

@gidon

 

create a parameter and use it the M Sentences. To be dynamic. If i change the parameter the filter is applied. Instead of 4 use the name of your parameter.

 

follow this link to know more about parameters

 

https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/

 

You can change the parameter value in Edit Query

 

im.png 

 




Lima - Peru

View solution in original post

7 REPLIES 7
BhaveshPatel
Community Champion
Community Champion

Hi Gidon, 

 

It is similar to the filter in Excel Table. Please see the attached screenshot.Number Filter : Greater than or Equal toNumber Filter : Greater than or Equal toFinal ResultsFinal Results

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Hello  bhavesh ,

I did make the filter as number filter it works fine

 

i want to do it in smater way  i did not fins where to write

the expresion you wrote 

=Table.SelectRows(#"Chandeg Type",each[year]>= 2007 )

 

in my qlik model I load only lines which are current year less 4  , it means only four years of data

 

what basicaly I am doing , I have an ERP that I analyse for the last five year using qlikview

Now I want to do the same with power BI , step by step

 

is is possible to  attach a file to this message .

 

i thank you very much for your help

 

gidon

 

 

 

 

 

 

Vvelarde
Community Champion
Community Champion

@gidon after apllied the filter you can change the M Sentence.

 

change to look like this:

 

= Table.SelectRows(#"Changed Type", each [year] >= Date.Year(DateTime.LocalNow())-4)




Lima - Peru

H Victor

you got a great  coutry , i have been there  spend few days in lima .

your answer is great , works fine ( now i understand what is M Sentence. )

 

one more question - how can I change in  this  

Date.Year(DateTime.LocalNow()) -4 )

 

the  4 to be as variable   .

thanks

gidon

 

Vvelarde
Community Champion
Community Champion

@gidon

 

create a parameter and use it the M Sentences. To be dynamic. If i change the parameter the filter is applied. Instead of 4 use the name of your parameter.

 

follow this link to know more about parameters

 

https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/

 

You can change the parameter value in Edit Query

 

im.png 

 




Lima - Peru

hello Victor

 

it works Great

 

thanks

 

gidon

 

 

Unfortunately not. You can upload in onedrive or google drive and send me the link.
Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

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.