The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Solved! Go to Solution.
Hi @JL0101
Return is missing from your formula, so please try this:
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.
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] ))).
Hi @JL0101
Return is missing from your formula, so please try this:
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.
Hi @JL0101,
I guess you should try using "&&" as AND, like: SUMX ( FILTER ( Table, CONDITION_1 && CONDITION_2 ), [Measure or Column] ).
Best Regards,
Alexander
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
20 | |
19 | |
18 | |
13 |
User | Count |
---|---|
41 | |
39 | |
24 | |
22 | |
19 |