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.
I am trying to create a more dynamic date filter for a report of mine that shows past and predicted data. I would like a filter that only shows data related to the current day (Today) tp Next 3 years to follow. For example from March3 2021 to March 3 2024. But I would like BI to be able to recognize what the current Day is so that when the next day begins it can automatically adjust the filter.
I am trying in date filters in Query editor as well but it's not working as expected.
Solved! Go to Solution.
Hi @Anonymous
You can click fx symbol beside the formula bar to add a step and paste below codes into the formula bar to filter the rows. "Changed Type" is name of the last step before you add this step. [Date] is the column which is filtered. Modify them according to your data.
= Table.SelectRows(#"Changed Type", each [Date] >= Date.From(DateTime.LocalNow()) and [Date] <= Date.AddYears(Date.From(DateTime.LocalNow()),3))
Kindly let me know if this helps.
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi @Anonymous
You can click fx symbol beside the formula bar to add a step and paste below codes into the formula bar to filter the rows. "Changed Type" is name of the last step before you add this step. [Date] is the column which is filtered. Modify them according to your data.
= Table.SelectRows(#"Changed Type", each [Date] >= Date.From(DateTime.LocalNow()) and [Date] <= Date.AddYears(Date.From(DateTime.LocalNow()),3))
Kindly let me know if this helps.
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
@Anonymous , You can create a column like this in Dax and use that as filter
Is Today = if('Date'[Date]>=TODAY() && 'Date'[Date]<=date(Year(TODAY())+3,month(TODAY()),day(TODAY())),1,0)
or in power query
if [Date] >= DateTime.Date(DateTime.LocalNow()) && [Date] <= Date.AddYears(DateTime.Date(DateTime.LocalNow()),3) then 1 else 0
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |