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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
h11
Helper III
Helper III

The following syntax error occurred during parsing: Invalid token, Line 5, Offset 46,.

I'm getting an error on my power Bi when I'm trying to type a measure. The error is "The following syntax error occurred during parsing: Invalid token, Line 5, Offset 46,. Please help.

 

h11_0-1715177709743.png

 

Thank you!

1 ACCEPTED SOLUTION
Slim-
Frequent Visitor

@h11Offset 46 is the end of your last line, I even think that you have only 45 caracters in line 5 so I tried creating two tables with same columns as you and pasting your measure : I did not have any error.

 

Are you sure that you do not have a caracter hidden at the end of your line 5 or a sixth line below ?

View solution in original post

4 REPLIES 4
halfglassdarkly
Responsive Resident
Responsive Resident

Very hard to read your screenshot at that resolution.

h11
Helper III
Helper III

@Slim- Measure = VAR _SelectedValue = SELECTEDVALUE('Table 2'[Name])
VAR _Filtered = CALCULATE(DISTINCTCOUNT('Table'[Name]),FILTER('Table','Table'[Status] IN {"Approved", "In Progress"} && 'Table'[Name]=_SelectedValue))
VAR _All = CALCULATE(DISTINCTCOUNT('Table'[Name]))
RETURN
IF(ISBLANK (_SelectedValue), _All, _Filtered)
Slim-
Frequent Visitor

@h11Offset 46 is the end of your last line, I even think that you have only 45 caracters in line 5 so I tried creating two tables with same columns as you and pasting your measure : I did not have any error.

 

Are you sure that you do not have a caracter hidden at the end of your line 5 or a sixth line below ?

Slim-
Frequent Visitor

Hi @h11,

I cannot read the measure in the picture because of the quality,

 

Can you please paste your measure ?

 

Regards,

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.