Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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.
Solved! Go to Solution.
@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)
@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)
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."
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.
That worked! Thanks so much for your swift response.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |