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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
arneshabobo
New Member

New Measure Error for Current Year Sales

Hi everyone. 

 

I'm working on a new measure for current year sales. I received the following error: 

 

The syntax for 'RETURN' is incorrect. (DAX(Var CY = MAX('Date Dim'[Year]RETURNCALCULATE(SUM(Actuals[Sales Amount],'Date Dim'[Year]=CY))).

 

Here is my formula:

Line 1 CY Sales = 

Line 2 Var CY = MAX('Date Dim'[Year]

Line 3

Line 4 RETURN

Line 5 CALCULATE(SUM(Actuals[Sales Amount],'Date Dim'[Year]=CY)

Line 6

 

I'm not sure why I received this error message. 

1 ACCEPTED SOLUTION
smpa01
Community Champion
Community Champion

@arneshabobo  try this, You missed the closing Parenthesis in VAR CY

 

CY Sales =
Var CY = MAX('Date Dim'[Year])
RETURN
CALCULATE(SUM(Actuals[Sales Amount]),'Date Dim'[Year]=CY)

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

6 REPLIES 6
smpa01
Community Champion
Community Champion

@arneshabobo  try this, You missed the closing Parenthesis in VAR CY

 

CY Sales =
Var CY = MAX('Date Dim'[Year])
RETURN
CALCULATE(SUM(Actuals[Sales Amount]),'Date Dim'[Year]=CY)

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Hi! Thank you for responding. I added the parenthesis but now the error says " too many arguments were passed to the SUM function. The maximum argument count for the function is 1."

Anonymous
Not applicable

HI @arneshabobo 

 

 You missed the closing paranthesis for the SUM function too, pls close it, it should work.

CALCULATE(SUM(Actuals[Sales Amount]) ,'Date Dim'[Year]=CY)

 

Thanks
Raj

Thanks so much for replying!

@arneshabobo  edited again, try now.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

That worked! Thanks so much for your swift response. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.