Forum Discussion

joemac130's avatar
joemac130
Regular Visitor
10 years ago
Solved

DAX Semantic error

VERY NEW to DAX and trying to work my way through...  Need assistance understanding the following error condition... Here is the DAX that I have created which returns the following error - I have ...
  • Eric_Zhang's avatar
    10 years ago

    joemac130

     

    Are Joe Reporting End Date and Joe Reporting Start Date measures? The error doesn't occur in the case that they are both calculated column. According to the BOL, DATEADD(<dates>,<number_of_intervals>,<interval>),  the first parameter <dates> should be a date column, if it is a measure in your case, the error occurs based on my test. 

     


    Joe Reporting Start Date :=

    DATEADD (
        [Joe Reporting End Date],
        CALCULATE (
            COUNTROWS ( CustomerReportingPeriod ),
            FILTER (
                ALL ( CustomerReportingPeriod[MonthIndex] ),
                CustomerReportingPeriod[MonthIndex]
                    MIN ( CustomerReportingPeriod[MonthIndex] )
            )
        ),
        MONTH
    )