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
RvdHeijden
Post Prodigy
Post Prodigy

Need help with my formula

Hello,

 

I need some help with my formula.

 

Totaal m1 geul = Countrows(filter(adressen;adressen[Project]="A"|| (adressen;adressen[Status]="Closed"))*[Gem.Lengte p/woning])

 

I need to filter base on 2 criteria (Project=A and Status=Closed) and that result * an average length (messure) 

It now returns an error Operator or expression '( )' is not supported in this context.

1 ACCEPTED SOLUTION

Ah, sorry, my bad!

 

With CALCULATE, rather than using the '&&', simply replace with a comma - e.g. 

 

CALCULATE (COUNTROWS (adressen), Adressen[Project] = "A", Adressen[Status] = "Closed") * Length

 

That should work.

 

 

View solution in original post

4 REPLIES 4
JDLee23
Helper I
Helper I

Hi,

 

I think you need to use the CALCULATE function (https://msdn.microsoft.com/en-us/library/ee634825.aspx), to allow you to filter as you need.

 

E.g. Totaal m1 geul = CALCULATE( COUNTROWS ( adressen ) , adressen[Project] = "A" && adressen[Status] = "Closed")) * AVG (length measure)

 

The '&&' gives you the AND operator (rather than ||, which is an OR operator). The formula above will count the rows in the table 'adressen' which have Project = A, and Status = Closed, multiplied by the average length measure.

 

Hope this helps!

 

@JDLee23

Thank you for your help

 

however the formula still has an error

 

Totaal m1 geul = CALCULATE(COUNTROWS(adressen);Adressen[Hoofdproject]="A" && 'Adressen'[Status Civiel]="Gesloten")*[Gem.Lengte p/woning]

 

The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.

Ah, sorry, my bad!

 

With CALCULATE, rather than using the '&&', simply replace with a comma - e.g. 

 

CALCULATE (COUNTROWS (adressen), Adressen[Project] = "A", Adressen[Status] = "Closed") * Length

 

That should work.

 

 

@JDLee23
That did the trick, thank you

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors