Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I have the follwoing table, and im trying to do a measure that can sum a coulmn minues 2 rows, though when filterd it on the rows that were filterd out it should give me thier values, my issue is that, my goal is if a selected any values the measure display its sum, but if didnt select anything it should give me the sum with counting 2 specifc values.
I want the card to display to sum A-1 and A-2 and give me a value of 10 but in the same time if i selected B-2 or B-2 i should see thier spicicf value (4) in the card.
Solved! Go to Solution.
Hi @Anonymous ,
We can create a measure using following measure to meet your requirement:
ConditionSum = IF ( ISFILTERED ( 'Table'[Column A] ), CALCULATE ( SUM ( 'Table'[Column B] ) ), CALCULATE ( SUM ( 'Table'[Column B] ), 'Table'[Column A] IN { "A-1", "A-2" } ) )
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can create a measure using following measure to meet your requirement:
ConditionSum = IF ( ISFILTERED ( 'Table'[Column A] ), CALCULATE ( SUM ( 'Table'[Column B] ) ), CALCULATE ( SUM ( 'Table'[Column B] ), 'Table'[Column A] IN { "A-1", "A-2" } ) )
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can use the combination of CALCULATE, SUM and ALLSELECTED functions to get the required output.
There are mutiple ways to achieve the same output in DAX.
Check out the behivour of the function in below:
https://www.sqlbi.com/articles/understanding-allselected/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |