Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply

SUMIFS WITHOUT SOME IDS

Hello everyone, I'm strugling to create a measure that gives me the sum of quantity that just includes IDs that doesn't have the collection.

In excel I have this table:

 

ABC
IDMATERIALQUANTITY
ACOLLECTION20
BEXTRA78
BCOLLECTION23
CEXTRA9
CCOLLECTION34
DEXTRA90
DCOLLECTION3
EEXTRA11
FEXTRA21

 

I need to get the sum of quantity from IDs that just have the EXTRA material. In other words, just the ID E and F in this case.

In excel, I created other table just with E and F in column E, then applied SUM(SUMIFS(C:C;B:B;"EXTRA";A:A;E3:E4)).

Thanks for the help!

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @massotebernoull,

 

How about this:

tomfox_0-1648324875617.png

Here the code:

TomsQuantityMeasure = 
VAR _helpTable =
SUMMARIZE ( 
    Table10,
    Table10[ID],
    "CountCollection", CALCULATE ( COUNT ( Table10[ID] ), Table10[MATERIAL] = "Collection" ),
    "CountExtra", CALCULATE ( COUNT ( Table10[ID] ), Table10[MATERIAL] = "Extra" )
)
RETURN
CALCULATE (
    SUM ( Table10[QUANTITY] ),
    FILTER ( _helpTable, [CountCollection] = BLANK() && [CountExtra] >= 1 )
)

 

Let me know if this helps! 🙂

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

4 REPLIES 4
tackytechtom
Super User
Super User

Hi @massotebernoull,

 

How about this:

tomfox_0-1648324875617.png

Here the code:

TomsQuantityMeasure = 
VAR _helpTable =
SUMMARIZE ( 
    Table10,
    Table10[ID],
    "CountCollection", CALCULATE ( COUNT ( Table10[ID] ), Table10[MATERIAL] = "Collection" ),
    "CountExtra", CALCULATE ( COUNT ( Table10[ID] ), Table10[MATERIAL] = "Extra" )
)
RETURN
CALCULATE (
    SUM ( Table10[QUANTITY] ),
    FILTER ( _helpTable, [CountCollection] = BLANK() && [CountExtra] >= 1 )
)

 

Let me know if this helps! 🙂

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

This one works pretty fine! Nice use of summarize, I never thought about it.

Thanks Tom!!

Samarth_18
Community Champion
Community Champion

Hi @massotebernoull ,

 

Create a measure like below:-

 

Measure = CALCULATE(SUM('Table'[QUANTITY]),FILTER('Table','Table'[MATERIAL] = "EXTRA"))

 

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Thanks for your help Samarth, but your measure will count IDs that also have 'collection' in the Material and I must count just the IDs that doesn't count it

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric Community.