Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear Friends,
I have the following table:
| Description | Value |
| Apple One | 3 |
| Orange One | 8 |
| Apple Two | 4 |
| Orange Two | 10 |
I have to sum those values which contains "Two" in the description.
How can one achieve that without using a lot of CALCULATE formulas?
Thanks
Solved! Go to Solution.
Hey @gianmarco ,
I think the best approach is without any CALCULATE at all 😉
Try that one:
Sum contains Two =
SUMX(
myTable,
IF(
CONTAINSSTRING( myTable[Description], "two" ),
myTable[Value]
)
)
Sum TWO =
CALCULATE(
SUM( 'Table'[Value] ),
CONTAINSSTRING( 'Table'[Description], "TWO" )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Sum TWO =
CALCULATE(
SUM( 'Table'[Value] ),
CONTAINSSTRING( 'Table'[Description], "TWO" )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hey @gianmarco ,
I think the best approach is without any CALCULATE at all 😉
Try that one:
Sum contains Two =
SUMX(
myTable,
IF(
CONTAINSSTRING( myTable[Description], "two" ),
myTable[Value]
)
)
Hey @gianmarco ,
you can also accept multiple posts as solution if they work for you 😉
But I'm happy you found a result for your problem.
Have a great weekend
Denis
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.