Help with Same year + previous 5 years DAX formula

willow1985

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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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