Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |