Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
New to all this ...
How can I filter import of tableA from Access, where field [Month] is equal/less than Tableb[CurMonth], a field we manually update when new month's data is ready to load on BI?
Thank you
Solved! Go to Solution.
thanks @austinsense 🙂
filter equal is easiest done by merging with JoinKind.Inner as described in these articles:
http://www.thebiccountant.com/2015/08/18/use-timeline-or-slicers-to-filter-your-power-query-import/
filter < is a bit different: There you have to use parameters. To do so you start filtering your table in the desired way by putting in a hardcoded value. After that you edit the resulting M-code and replace the hardcoded value by the parameter.
The parameter can be retrieved from a table by it's coordinates:
queryname[Columnname]{Rownumber-1}
So say your parameter sits in the first row the expression would be: Tableb[CurrMonth]{0}
Rownumber is zero because M starts to count with 0 (for the 1st row)
So this is how the parametrized filter would look like:
= Table.SelectRows(Source, each [Month] < Tableb[CurrMonth]{0})
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
@ImkeF do you have some query magic for this guy?
thanks @austinsense 🙂
filter equal is easiest done by merging with JoinKind.Inner as described in these articles:
http://www.thebiccountant.com/2015/08/18/use-timeline-or-slicers-to-filter-your-power-query-import/
filter < is a bit different: There you have to use parameters. To do so you start filtering your table in the desired way by putting in a hardcoded value. After that you edit the resulting M-code and replace the hardcoded value by the parameter.
The parameter can be retrieved from a table by it's coordinates:
queryname[Columnname]{Rownumber-1}
So say your parameter sits in the first row the expression would be: Tableb[CurrMonth]{0}
Rownumber is zero because M starts to count with 0 (for the 1st row)
So this is how the parametrized filter would look like:
= Table.SelectRows(Source, each [Month] < Tableb[CurrMonth]{0})
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Thank you! The imported data table now only shows up to month specified in TableB[mnt]. But, the reports 'working of' this table still include later data, i.e. I though this would restrict all reports based on that table to be limited to that?
I.e. used: #"Up to Month" = Table.SelectRows(_CSI, each [Month] <= DBmnt[Mnt]{0})
That's not the expected behaviour.
I know this is stupid question (but I have no other idea): Are you sure that the following queries are actually referencing this query of did you develop them earlier by just copying the original query? Then you had to apply this filter there as well.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Yes, my 'previous' filter was interfering ... now fixed and working.
Thank you for your assistance - really appreciated!
Create a calculcated column which checks for the "size" of the month and compare. If comparison is true, parse "Yes", otherwise "No". Then use this help-column for filtering via filter pane or slicer.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
79 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |