Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello everyone,
Here is my problem:
I need to create a measure that sum all the value greater than 0.05 after aggregation.
I have a table like this:
Name | Value |
A | 0.05 |
A | 0.01 |
A | 0.02 |
B | 0.01 |
B | 0.01 |
B | 0.02 |
C | 0.01 |
C | 0.04 |
C | 0.02 |
The aggregation looks like this but I don't want to create a new table for this:
Name | Value |
A | 0.08 |
B | 0.04 |
C | 0.07 |
The measure should return 0.15 because only A and C are greater than 0.05.
Can this be done in DAX without creating a new aggregated table?
Thank you for the incoming answers,
David
Solved! Go to Solution.
Hi @Anonymous
This should do the trick
Measure =
SUMX(
VALUES( 'Table'[Name] ),
CALCULATE(
VAR __sum = SUM( 'Table'[Value] )
RETURN IF( __sum > 0.05, __sum )
)
)
@Anonymous oops, try this
Measure 2 =
SUMX (
VALUES ( Test[Name] ),
VAR __s = CALCULATE( SUM ( Test[Value] ) )
RETURN IF ( __s > 0.05, __s )
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Anonymous
This should do the trick
Measure =
SUMX(
VALUES( 'Table'[Name] ),
CALCULATE(
VAR __sum = SUM( 'Table'[Value] )
RETURN IF( __sum > 0.05, __sum )
)
)
@Anonymous use this measure
Sum over value =
VAR _s = SUM ( Test[Value] )
RETURN
SUMX (
FILTER( VALUES ( Test[Name] ), _s > 0.05 ),
_s
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi parry2k,
Thanks for your time.
The result is not what I expect. The measure gives 0.57 (which is 3 times the total value)
@Anonymous oops, try this
Measure 2 =
SUMX (
VALUES ( Test[Name] ),
VAR __s = CALCULATE( SUM ( Test[Value] ) )
RETURN IF ( __s > 0.05, __s )
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
123 | |
101 | |
71 | |
61 |