Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
89 | |
75 | |
69 | |
65 | |
58 |
User | Count |
---|---|
103 | |
94 | |
74 | |
60 | |
59 |