Forum Discussion

Vladan's avatar
Vladan
Regular Visitor
4 years ago
Solved

Dateadd issue with quarter

Hello,    I encountered problem with dateadd function when trying to calculate values from previous quarter. Same problem as in post below: DateAdd problem with Quarter - Microsoft Power BI Commun...
  • v-zhangti's avatar
    4 years ago

    Hi, Vladan 

     

    This problem may be due to the fact that DATEADD does not correctly identify the end of the month, and on June 30 he wants to return March 30, but there is no such date in the table.

    You can try the function EDATE. https://docs.microsoft.com/dax/edate-function-dax 

    At this time, two dates appear, March 30 and March 31. In order to display the dates of the previous quarter, you can try to specify the data range in the form of Year-month.

    Measure = 
    CALCULATE('Table'[Assets 1],FILTER(ALL('Table'),[Year Month]=SELECTEDVALUE('Table'[Last Quarter])))

    Is this the output you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.