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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Syndicate_Admin
Administrator
Administrator

SUM with two-variable filter

Hello Community,

Can you help me explain the correct way to apply the two-variable filter to the sum of a column of data?

I created a variable called EAC 2024 according to the graph, Here I have applied a single filter (OPEN) and the two values match:

Jprada_0-1703786107777.png

But when I apply two filters: OPEN and CLOSED, the EAC variables become zero.

Jprada_1-1703786209087.png


Which I need to adjust in the DAX code.

Thank you

Julian P.

3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 
This happens because the state can't be open and closed at the same time.
If you need to return the result of open+closed please use "||" instead of "&&" (or instead of and).
In other case 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hi @Syndicate_Admin 
You have the wrong syntax...

The end of the measure should be 
...'projects[project state] = "open" || 'projects[project state] = "closed"

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Fixed with the correct syntax.

Jprada_0-1704233546700.png

View solution in original post

4 REPLIES 4
Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 
This happens because the state can't be open and closed at the same time.
If you need to return the result of open+closed please use "||" instead of "&&" (or instead of and).
In other case 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hello

I agree with what you say in the condition that applies to the filter, however I can't manage to apply it correctly:

Jprada_3-1703791581008.png




I also did this test without success:

Jprada_0-1703791185059.png

Hi @Syndicate_Admin 
You have the wrong syntax...

The end of the measure should be 
...'projects[project state] = "open" || 'projects[project state] = "closed"

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Fixed with the correct syntax.

Jprada_0-1704233546700.png

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.