Forum Discussion
internwithquest
2 years agoFrequent Visitor
The syntax for ')' is incorrect
I am using the following DAX formula to try and calculate the total earnings of last month one year prior to now:
Rev Last Month Last Year =
VAR LatestDate = MAX(OrderHead[InvoicePeriodDate])
VAR PrevYear = YEAR(LastDate) - IF(MONTH(LastDate) = 1, 1, 0)
VAR PrevMonth = IF(MONTH(LastDate) = 1, 12, MONTH(LastDate) - 1)
VAR Result = CALCULATE(SUM(OrderHead[CustomerTotal]), YEAR(OrderHead[InvoicePeriodDate]) = PrevYear, MONTH(OrderHead[InvoicePeriodDate]) = PrevMonth)
RETURN Result
This gives me the error "The syntax for ')' is incorrect.".
What am I missing here?
Found my error, my variable name is not the same when I call it
1 Reply
- internwithquestFrequent Visitor
Found my error, my variable name is not the same when I call it