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.
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
Solved! Go to Solution.
@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)
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
Hi Gidon,
It is similar to the filter in Excel Table. Please see the attached screenshot.
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
@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)
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
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
hello Victor
it works Great
thanks
gidon
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |