Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need help in Dax (Date based calculation)

Hello Dax Experts,   I need help in DAX.   I have 2 tables in my data:   Table1 Parameter1 Parameter2 Date1 Amount A X 01-01-2019 10 B X 02-01-2019 20 C X 03-01-2019 ...
  • amitchandak's avatar
    6 years ago

    Create a common dimestion DATE
    Create a common using Parameter1 Parameter2 from table 1

    like
    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.