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
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
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.