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

Filter date until this month

Hi,

 

I have Leave Data from dynamics.

So I have 2 types of leave, 1 is Leave Credit, and 1 is Annual Leave.

the Leave Credit data is already loaded until the end of the year. Example:

we have 2016 and 2017 data, for 2016 we just put it as leftover in the first January.

For Now I put the filter (in edit queries) date is in year this year or leave type not equals leave credit.

So if it's not November yet the data for Leave credit only shown until October.

 

But if the years in 2018, in month March, the leave credit only will be shown at March 2017 - March 2018.

There will be no data for January, and February 2017. What I need is the filter all the data until this month.

But using filter in Edit Query because I already create some calculation there.

 

I hope you can understand my question and example.

 

Thanks,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Already found the answer!

 

= Table.SelectRows(#"Name of Previous Step", each [pafo_EstimatedEndDate] <= DateTime.LocalNow())

 Just want to share if someone needs it 🙂

 

Thanks!

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Up, hoping someone can help

Anonymous
Not applicable

Already found the answer!

 

= Table.SelectRows(#"Name of Previous Step", each [pafo_EstimatedEndDate] <= DateTime.LocalNow())

 Just want to share if someone needs it 🙂

 

Thanks!

Anonymous
Not applicable

Hi conniedevina,

could you please share the workbook 🙂

Thank you in advance!

 

Best Regards,

Anastasiia Lagunova

Anonymous
Not applicable

Hi @Anonymous,

 

Please check this link for the workbook and data source (Excel).

 

Thanks,
Regards,
Connie

v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may select "Custom Filter..." and do research into The Advanced Editor.

    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each Date.IsInPreviousNMonths([Date], 12) or Date.IsInCurrentMonth([Date]))
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

but if you use

Date.IsInPreviousNMonths([Date], 12) 

 It will be only take data for last year right?

 

Example the data already from January 2017 - March 2018.

Today month is February 2018, it will only take data from February 2017 - February 2018 right?

What I need is the data from January 2017 - February 2018 (if the example today is february).

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.