cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mohanad17
Frequent Visitor

( Sum Measure ) when unfiltered sum everything except 2 values

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.

 

test1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: ( Sum Measure ) when unfiltered sum everything except 2 values

Hi @Mohanad17 ,

 

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" }
    )
)

8.PNG9.PNG

 


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.

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.

View solution in original post

3 REPLIES 3
BhaveshPatel Community Champion
Community Champion

Re: ( Sum Measure ) when unfiltered sum everything except 2 values

Hi @Mohanad17 

 

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/

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Community Support
Community Support

Re: ( Sum Measure ) when unfiltered sum everything except 2 values

Hi @Mohanad17 ,

 

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" }
    )
)

8.PNG9.PNG

 


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.

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.

View solution in original post

Community Support
Community Support

Re: ( Sum Measure ) when unfiltered sum everything except 2 values

Hi @Mohanad17 ,


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.

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.

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors