Help with Same year + previous 5 years DAX formula

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
728
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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

mart37

Well-known Member
Joined
Aug 4, 2017
Messages
1,096
Office Version
  1. 2016
Platform
  1. Windows
Power Query:
= Table.SelectRows(#"Changed Type", each Date.IsInPreviousNYears([Date Received], 5) or Date.Year([Date Received]) = Date.Year(Date.From(DateTime.LocalNow())))
 
Solution

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
728
Office Version
  1. 365
Platform
  1. Windows
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:
 

Forum statistics

Threads
1,136,303
Messages
5,674,966
Members
419,537
Latest member
ucatchy

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
Top