Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I had numerous measures using the VAR keyword in Power BI that worked fine until the last update in November. I found that I could fix the issue by just altering the syntax just a little bit (I think i added a space, something not intuitive... took me hours to figure it out). Any ways, I'm using the same logic for a new measure in Power BI. once again, it's now not working. This is the same logic I've used on previous measures using VAR. Can someone please help me? This is incredibly frustrating.
The syntax is below. The error I get is "The syntax for 'RETURN' is incorrect" followed by a long string of text. Below is the measure formula I am using. I am trying to use the VAR MaxDate to filter my selection of data.
UL % Curr Mo = VAR MaxDate = MAX('Loss Cat Data'[PE FC MoYr] RETURN CALCULATE(SUM('Loss Cat Data'[Potential]), 'Loss Cat Name'[Loss Type] = "U", 'Loss Cat Data'[PE FC MoYr] = DATE(YEAR(MaxDate), MONTH(MaxDate), DAY(MaxDate))) / CALCULATE(SUM('Loss Cat Data'[Potential]))
Solved! Go to Solution.
Hi @Anonymous
On my first look I saw a missing ) in VAR highlighted in RED below
UL % Curr Mo = VAR MaxDate = MAX('Loss Cat Data'[PE FC MoYr]) RETURN CALCULATE(SUM('Loss Cat Data'[Potential]), 'Loss Cat Name'[Loss Type] = "U", 'Loss Cat Data'[PE FC MoYr] = DATE(YEAR(MaxDate), MONTH(MaxDate), DAY(MaxDate))) / CALCULATE(SUM('Loss Cat Data'[Potential]))
Hi @Anonymous
On my first look I saw a missing ) in VAR highlighted in RED below
UL % Curr Mo = VAR MaxDate = MAX('Loss Cat Data'[PE FC MoYr]) RETURN CALCULATE(SUM('Loss Cat Data'[Potential]), 'Loss Cat Name'[Loss Type] = "U", 'Loss Cat Data'[PE FC MoYr] = DATE(YEAR(MaxDate), MONTH(MaxDate), DAY(MaxDate))) / CALCULATE(SUM('Loss Cat Data'[Potential]))
Well now I feel embarassed - that fixed it. Thanks !!