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.
Hello,
Can anyone help me with creating a date filter to include all dates in the range of past 6 months and next 6 months relative to today's date..assuming date_dt is the date field
Hi @Anonymous ,
You could refer to @amitchandak ' suggestions, or you also could try to +/-180 days like below
Measure = CALCULATE(SUM(t2[amount]), FILTER(t2, t2[date]<=DATE(YEAR(TODAY()), MONTH(TODAY()), DAY(TODAY())+180)&& t2[date]>=DATE(YEAR(TODAY()), MONTH(TODAY()), DAY(TODAY())-180)))
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Zoe Zhi
@Anonymous ,
Measure =
var _min = date(year(today()),month(today())-6,day(today())) /// or date(year(today()),month(today())-6,1)
var _max = date(year(today()),month(today())+6,day(today())) /// eomonth(date(year(today()),month(today())+6,day(today())),0)
return
calculate([measure],filter(All(DATE), Date[Date] >=_min && Date[Date] <=_max))
Thanks Amit
Thanks Nandu
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |