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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Vaines
Regular Visitor

I can't add a third filter to my Calculate

Greetings,

 

For some reason unknown to me, in a Calculate function that I use to calculate an average, Power BI Desktop always returns an error as soon as I try to add a third filter. I tried placing the filters in a different order, but it's always the one placed third that has red underlining (appearing as soon as I start typing the first letter) and whose variable name is greyed out. Can you help me understand ? I have looked up the question online, but only found related things that didn't quite seem to have the same problem.

 

Here is my measure that works (and has been used in previous dashboards) :

 

Bezettingsgraad = CALCULATE(AVERAGE(Groups[Bezetting]), Groups[Status] = "Started" || Groups[Status] = "Ended", Groups[Group_Max_Participants] <> 0)

 

And here is the one with the third filter I want to add in, but that makes it all bug :

 

Bezettingsgraad = CALCULATE(AVERAGE(Groups[Bezetting]), Groups[Status] = "Started" || Groups[Status] = "Ended", Groups[Group_Max_Participants] <> 0, Groups[Periode] = 1)

 

==> The error returned is "The syntax for "Groups" is incorrect.

1 ACCEPTED SOLUTION
petrovnikitamai
Resolver V
Resolver V

Bezettingsgraad = CALCULATE(AVERAGEX(FILTER(Groups,Groups[Periode] = 1),Groups[Bezetting]), Groups[Status] = "Started" || Groups[Status] = "Ended", Groups[Group_Max_Participants] <> 0)

idk but try third filter use in averageX

View solution in original post

2 REPLIES 2
petrovnikitamai
Resolver V
Resolver V

Bezettingsgraad = CALCULATE(AVERAGEX(FILTER(Groups,Groups[Periode] = 1),Groups[Bezetting]), Groups[Status] = "Started" || Groups[Status] = "Ended", Groups[Group_Max_Participants] <> 0)

idk but try third filter use in averageX

Thank you petrovnikitamai, this has worked!

 

However I am still confused as to why Power BI just won't let me have more than 2 filters with Calculate, whereas everywhere I look, it says there can be an infinite amount of filters.

Helpful resources

Announcements
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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.