Forum Discussion

Raul's avatar
Raul
Post Patron
4 years ago
Solved

DAX Formula for a date field

Hello Community!   I have the Calendar table related to the Table1 table by the field Calendar[Date] - Table1[Date] and related to the Table2 table by the field Calendar[Date] - Table2[Date]. I ne...
  • Raul's avatar
    Raul
    4 years ago

    Of course:

    Measure = 

       VAR varYear = SELECTEDVALUE(Calendar[Year])
       VAR varPVY = CALCULATE(SUM(Table2[Amount]), ALL(Calendar), DATESBETWEEN(Table2[Date], DATE(varYear+1,09,01), DATE(varYear+1,12,31)))
       VAR varACY = CALCULATE(SUM(Table1[Amount]), ALL(Calendar), DATESBETWEEN(Table1[Date], DATE(varYear,01,01), DATE(varYear,03,31)))
    RETURN
       varPVY + varACY