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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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