Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
GrantC101
New Member

previous month last month filter

Hello All

 

Looking at getting some help with hopefully a simple filter.

I have been using the basic filters for Data filtering and have been asked to provide seprate tables for last months and any information before last month. The "last month" is easy, i am struggling with everything before last month with out showing last month.

I am unfimilier with dax and can only use the built in functions.

hopefully this makes sense and hoping to get some help

 

1 ACCEPTED SOLUTION

I have managed to achieve this using the following;

each [Date Reported]<=Date.AddMonths(Date.From(Date.EndOfMonth(DateTime.LocalNow())),-2))

 

thank you for the help

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Oh, your original post mentioned DAX. It's even easier in Power Query. In the formula bar:

= Table.SelectRows(Name of PriorStep, each [DateColumnName] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -2)))

 

--Nate

Anonymous
Not applicable

Calculate(Sum(SomeTable[ColumnName]), Filter(WhateverTable, WhateverTable[Date] <= EOMONTH(TODAY(), -1)))

 

--Nate

Thank you for the quick reply how would I put this into Power Query Editor?

I have managed to achieve this using the following;

each [Date Reported]<=Date.AddMonths(Date.From(Date.EndOfMonth(DateTime.LocalNow())),-2))

 

thank you for the help

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors