Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
internwithquest
Frequent 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?
1 ACCEPTED SOLUTION
internwithquest
Frequent Visitor

Found my error, my variable name is not the same when I call it

View solution in original post

1 REPLY 1
internwithquest
Frequent Visitor

Found my error, my variable name is not the same when I call it

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.