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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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