Help with Same year + previous 5 years DAX formula

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
915
Office Version
  1. 365
Platform
  1. Windows
I am brand new to Power BI. I would consider myself a advanced user in excel but am struggling getting started with Power BI.

I just converted/made a new column for dates that were converted from Unixtime (was not easy to figure out). Now I just need to add a filter to only bring in the last 5 years including the current year.

I cant seem to get the current year. How would I modify this DAX formula to include the current year as well?

Power Query:
= Table.SelectRows(#"Changed Type", each Date.IsInPreviousNYears([Date Received], 5))

Any help would be greatly appreciated!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Power Query:
= Table.SelectRows(#"Changed Type", each Date.IsInPreviousNYears([Date Received], 5) or Date.Year([Date Received]) = Date.Year(Date.From(DateTime.LocalNow())))
 
Upvote 0
Solution
Works perfect! you are a life saver!

I have so much to learn so I know I will be on this board a lot. Thank you again! :giggle: :giggle: :giggle:
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top