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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ce138867
Resolver II
Resolver II

Syntax error when using calculate function with multiple filters

I am trying to create a measure with the following formula

 

Measure1= CALCULATE(
    DISTINCTCOUNT('Baseline'[FIN]),FILTER('Baseline',[Episode Trigger Status]= "Post-Trigger"}
&& 'Baseline',Baseline[Encounter Type] = "IP"))
 
The error displayed is: The syntax for '}' is incorrect. (DAX(CALCULATE( DISTINCTCOUNT('Baseline'[FIN]),FILTER('Baseline',[Episode Trigger Status]= "Post-Trigger Encounter"}&& 'Baseline',Baseline[Encounter Type] = "101 - Inpatient")))).
 
Any suggestions?
1 ACCEPTED SOLUTION
Megha166
Microsoft Employee
Microsoft Employee

@ce138867 Try This:

 Measure1= CALCULATE(
    DISTINCTCOUNT('Baseline'[FIN]),FILTER('Baseline',AND([Episode Trigger Status]= "Post-Trigger",Baseline[Encounter Type] = "IP")))

View solution in original post

5 REPLIES 5
Megha166
Microsoft Employee
Microsoft Employee

@ce138867 Try This:

 Measure1= CALCULATE(
    DISTINCTCOUNT('Baseline'[FIN]),FILTER('Baseline',AND([Episode Trigger Status]= "Post-Trigger",Baseline[Encounter Type] = "IP")))

Thanks @Megha166, that worked like a charm!

@ce138867 

Measure1= CALCULATE(
    DISTINCTCOUNT('Baseline'[FIN]),FILTER('Baseline',AND([Episode Trigger Status]= "Post-Trigger",Baseline[Encounter Type] = "IP")))

ce138867
Resolver II
Resolver II

NVM, I saw that I had a "}" that I needed to delete. With that removed, I now get the error: Too many arguments were passed to the FILTER function. The maximum argument count for the function is 2.

@ce138867 

 

Try This

 

CALCULATE(
    DISTINCTCOUNT(
        'Baseline'[FIN]
        ),
       FILTER('Baseline',
       [Episode Trigger Status]= "Post-Trigger Encounter"
      &&
     'Baseline',Baseline[Encounter Type] = "101 - Inpatient"
     )
)
 
 
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.