Forum Discussion
Need help in Dax (Date based calculation)
- 6 years ago
Create a common dimestion DATE
Create a common using Parameter1 Parameter2 from table 1like
Table 3 = distinct(summarize(Table1,table1[Parameter1],table1[Parameter2])
Join to both tables using parameter 1
Value =
var _max = minx(Date,Date[Date])return
calculate(count(table1[Amount],filter(all(Date),Date[Date]>=_max))
Unit =
var _max = minx(Date,Date[Date])return
calculate(count(table2[Unit],filter(all(Date),Date[Date]<=_max))Appreciate your Kudos.
Can you explain the logic of where the unit values 6 and 33 are coming from? I am not clear on this. Just in plain language.
Hello Greg,
Sure 🙂
Units is coming from Table2. Sum of units where Date2 is less then or equal to 03-01-2019.
Amount is coming from Table1. Sum of Amount where Date1 is more then or equal to 03-01-2019.
We have Date1 as a slicer as on or before in the report.
I hope I am clear enough now 🙂
Thanks!