Forum Discussion
MAX date filtering
Good afternoon
I have a report where I have two data tables. One of sale (Consultation A) where the date is normally today -3 days and another of other types of services (Consultation B) that is today -1.
I would like to know how I can establish a filter where I take the sales of both but being the maximum date, the maximum date of query A. For the pages where I am for example reporting the sales of the current month and that go from 01/09/2023 to Max(Query To [date of sale])
Thanks in advance
1 Reply
- amitchandakSuper User
M1 =
var _date = maxx(allselected(Table1) , Table1[Date])
return
calculate(sum(Table1[Value]), filter(Table1, Table1[Date]= _date))
M2 =
var _date = maxx(allselected(Table2) , Table2[Date])
return
calculate(sum(Table2[Value]), filter(Table2, Table2[Date]= _date))
In case you need to remove a filter context on date
M2 =
var _date = maxx(all(Table2) , Table2[Date])
return
calculate(sum(Table2[Value]), filter(all(Table2), Table2[Date]= _date))