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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

')' expected, but all () statements are closed

Hello,

 

I am getting an error in Power BI Report Builder that I am positive I should not be getting. I'll let it speak for itself.

 

Here is the error message:

Databar error message.png

But here is the formula for "DataBar2":

Databar formula.png

Can you see the problem?

 

All four sets of parentheses have an opening and closing parenthesis, but the error message says that it expects a closing parenthesis somewhere.

 

My question is, where does it expect the closing parenthesis, and why?

 

Please ensure you have thoroughly read the question and passed a Captcha before responding. I don't want another extremely unhelpful response from a bot.

 

EDIT: Here is some context:

The "Percent" in the formula refers to a dataset I have named Percent. The deductible value was taken from the same cube in both my main and Percent datasets, but the percent dataset aggregates by State and Year fields while the main one also aggregates by City. The above formula is used for the City level databar.

 

The goal is to have a report that separates the data by state and city, with the parameter being Year. I figured that by creating a new dataset that gives the deductible by year and state, I could get subtotals for each state within each year.

 

Here's a sample of the report in design view:

designer mode.png

And here's a picture of what the report currently looks like without the databar:

report mode wo data bar.png

The far right column is supposed to show the total by state or city and year. 99,669.71 is the grand total, but 4100 is the total for the year 2005. 4100 is shown at the bottom as a total column, as shown here:

report mode wo data bar total.png

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

So if the "Percent" is meant to refer to a dataset then it's in the wrong spot. I'm guessing that you want the denominator of your divide operation to come from this dataset, if that is the case then you need to move the closing bracket for your SUM function.

d_gosbell_0-1668055992940.png

In your expression, the SUM function has been closed already and it is expecting another closing bracket to close the one at the start of the SUM call. 

View solution in original post

3 REPLIES 3
d_gosbell
Super User
Super User

So if the "Percent" is meant to refer to a dataset then it's in the wrong spot. I'm guessing that you want the denominator of your divide operation to come from this dataset, if that is the case then you need to move the closing bracket for your SUM function.

d_gosbell_0-1668055992940.png

In your expression, the SUM function has been closed already and it is expecting another closing bracket to close the one at the start of the SUM call. 

d_gosbell
Super User
Super User

It's probably the extra , "Percent" you have in the formula. I can't see what that is supposed to relate to, but it does not look like a valid expression with that in there.

Anonymous
Not applicable

I appreciate your help. See the edit for more details on the project.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.