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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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