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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Cze-Jhin
Frequent Visitor

The syntax for ")" is incorrect in powerBI measures

Hi All,

I'm pretty new in the powerBI world, and am stuck with a syntax error, hope you can help me with it.

I would like to achieve the following formula = IFERROR((Grandtotal-Outcome A- Outcome B- Outcome C- Outcome D)/ Grandtotal, 0) via PowerBI. 

However, I keep receiving the "Syntax for ')' is incorrect" error, I have tried to remove some brackets or changed the type of brackets, but it still doesnt work. May I know how to fix the issue?

 

May refer to the following code sample I am using for DAX in PowerBI.

Test Rate 2 = 
DIVIDE(
    {CALCULATE({CALCULATE(COUNTROWS('Table1'), ALL('Table1'))
                -
                COUNTROWS('Table1'), 
                    FILTER(VALUES('Table1'[AttemptOutcomeName]), 'Table1'[AttemptOutcomeName] IN {"Outcome A"})
                -
                COUNTROWS('Table1'), 
                    FILTER(VALUES('Table1'[AttemptOutcomeName]), 'Table1'[AttemptOutcomeName] IN {"Outcome B"})
                -
                COUNTROWS('Table1'), 
                    FILTER(VALUES('Table1'[AttemptOutcomeName]), 'Table1'[AttemptOutcomeName] IN {"Outcome C"})
                -
                COUNTROWS('Table1'), 
                    FILTER(VALUES('Table1'[AttemptOutcomeName]), 'Table1'[AttemptOutcomeName] IN {"Outcome D"})})
,
    CALCULATE(COUNTROWS('Table1'), ALL('Table1'))
)

 Thank you, would really appreciate if you could help with it.

 

@PowerBI 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The very start of the formula begins with curly brackets, try replacing them with round ones.

DIVIDE(
    (CALCULATE((CALCULATE(COUNTROWS('Table1'), ALL('Table1'))

View solution in original post

4 REPLIES 4
Cze-Jhin
Frequent Visitor

Thank you @Anonymous 

Anonymous
Not applicable

The very start of the formula begins with curly brackets, try replacing them with round ones.

DIVIDE(
    (CALCULATE((CALCULATE(COUNTROWS('Table1'), ALL('Table1'))

Hi Everyone, 

Below is my code in Dax Table and I am getting syntax error. Please help.

 

Calendar =
Var _cal = CALENDAR(MIN(Date1[Date-1]), MAX(Date1[Date-1]))
Var _result =
ADDCOLUMNS(
    _cal,
    "Year", YEAR([Date]),
    "Month", FORMAT([Date], "mmmm"),
    "MonthNum", MONTH([Date]),
    "Year Month", FORMAT([Date], "yyyy mmm"),
    "Year Month Sort", FORMAT([Date], "yyyymm"),
    "Day of Month", DAY([Date])
)
return
Anonymous
Not applicable

All formulas in round brackets and text in curly brackets

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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