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.
Hi all,
I am trying to create a dynamic filter in M that allows me to filter my dataset on the days that I can request.
For example I use a filter: URL/Page$filter=createdAt gt 90d_ago
But I want to use the days Year to date, "Duration.Days(DateTime.LocalNow() - Date.StartOfYear(DateTime.LocalNow()))" then I append this to the rest of the filter ends like this: $filter=createdAt gt 63d_ago
I try to set it up as a query but the default value is always "createdAt gt 63ago".
how can I make to add 63 dynamically?
Best,
Jorge
Solved! Go to Solution.
Hi @Jmenas,
If I understand you correctly, you should be able to use the following query to filter the data dynamically.
days = Duration.Days(DateTime.LocalNow() - Date.StartOfYear(DateTime.LocalNow())), filters = "createdAt gt "&Text.From(days)&"ago",
URL/Page$filter = filters
Regards
Hi @Jmenas,
If I understand you correctly, you should be able to use the following query to filter the data dynamically.
days = Duration.Days(DateTime.LocalNow() - Date.StartOfYear(DateTime.LocalNow())), filters = "createdAt gt "&Text.From(days)&"ago",
URL/Page$filter = filters
Regards
Hi @v-ljerr-msft,
but in case I want to inside of a parameter that will still be the case right?
I will test it in both cases because I also want to give the user the possibility of not using the filter in some cases.
Best,
J.
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |