cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## How to create a sumx with 2 filter conditions

I have the following code

PivCouplers-Male =

SUMX(
FILTER(
PivCouplers,
CONTAINSSTRING(('PivCouplers'[shape_code]),"m")),[SumOfShapeCode])

How do I add an aditional Filter below CONTAINSSTRING to include something along the lines of AND take the latest model, i.e. what is the syntax for 2 filters or more on the SUMX ?

Thanks

1 ACCEPTED SOLUTION
Community Support

Hi @JL0101

``````VAR MaxRevision =
MAX ( 'PivCouplers'[A-schedule_revision_numbers] )
RETURN
SUMX (
FILTER (
PivCouplers,
CONTAINSSTRING ( ( 'PivCouplers'[shape_code] ), "m" )
&& 'PivCouplers'[A-schedule_revision_numbers] = MaxRevision
),
[SumOfShapeCode]
)``````

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Helper II

The syntax for 'SUMX' is incorrect. (DAX(VAR MaxRevision = MAX('PivCouplers'[A-schedule_revision_numbers])SUMX( FILTER( PivCouplers, CONTAINSSTRING(('PivCouplers'[shape_code]),"m") && 'PivCouplers'[A-schedule_revision_numbers] = MaxRevision ),[SumOfShapeCode] ))).

Community Support

Hi @JL0101

``````VAR MaxRevision =
MAX ( 'PivCouplers'[A-schedule_revision_numbers] )
RETURN
SUMX (
FILTER (
PivCouplers,
CONTAINSSTRING ( ( 'PivCouplers'[shape_code] ), "m" )
&& 'PivCouplers'[A-schedule_revision_numbers] = MaxRevision
),
[SumOfShapeCode]
)``````

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

Hi @JL0101,

I guess you should try using "&&" as AND, like: SUMX ( FILTER ( Table, CONDITION_1 && CONDITION_2 ), [Measure or Column] ).

Best Regards,

Alexander

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors