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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
GreenKnight1294
Frequent Visitor

SUMIFS Equivalent to Check for Row Value

Good evening.

 

I'm trying to build a SUMIFS equivalent formula that checks the value of a given row and sums the values in a column that match the values of that row. I wrote the following formula:

 

=CALCULATE(SUM('TABLE'[Quantity]),

FILTER('TABLE',[Registry]="2290"),

FILTER('TABLE',[Type]="Print")

)

 

I would really appreciate some help coding a version of it that checks the value of the current row rather than a fixed constant of "2290".

 

Thank you!

2 ACCEPTED SOLUTIONS

Hi @GreenKnight1294  on this table my solution works.

I can't figure out what the problem is.

"Fix" a cell in POWER BI is not possible because of the logic it uses

Rather than working at the cell level, it works at the column level.

It's a game where you release filters and apply filters in a context.

Sumifs in the context of multiple conditions is like I showed calculate ([measure], condition A && condition B etc..)

 

Unfortunately, I don't know how to help beyond that...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Ahmedx
Super User
Super User

pls try this

Column = 
VAR t1 = [Registry]
VAR t2 = [Type]
VAR _Results = SUMX(FILTER(ALL('Table'),'Table'[Registry]=t1&&'Table'[Type]=t2),[QTY])
RETURN
_Results

Screenshot_2.png

View solution in original post

10 REPLIES 10
Ahmedx
Super User
Super User

pls try this

Column = 
VAR t1 = [Registry]
VAR t2 = [Type]
VAR _Results = SUMX(FILTER(ALL('Table'),'Table'[Registry]=t1&&'Table'[Type]=t2),[QTY])
RETURN
_Results

Screenshot_2.png

Sir, you're a wizard. I wish I could give you more than just a thumbs up.

 

harry-potter-sorcerers-stone

GreenKnight1294
Frequent Visitor

Thank you, Rita.

 

Here's a similar table to what I showed before with the desired result.

 

The fourth column has the following formula in Excel:

=SUMIFS($A$2:$A$20,$B$2:$B$20,B2,$C$2:$C$20,C2)

 

QTYRegistryTypeSUM
22290print40
82290print40
102290print40
122291print27
132291print27
22291print27
02291print27
32292print29
82292print29
72292print29
62292print29
52292print29
92290print40
112290print40
162294print43
192294print43
52294print43
32294print43

 

The most important part is that all the numbers that share the same registry value are added together.

Ritaf1983
Super User
Super User

Hi @GreenKnight1294 
Try :

=CALCULATE(SUM('TABLE'[Quantity]),FILTER('TABLE',[Registry]="2290"&& [Type]="Print"),

)

 

Make sure that data type of registry column is text :

Ritaf1983_1-1689969004025.pngRitaf1983_2-1689969039871.png

 

Link to a sample file 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hey Rita,

 

Thank you so much for taking your time to check this.

 

This isn't exactly what I'm looking for.

 

Would it be possible to have these values calculated in every row of the table? Per your example I want the following to show in PowerPivot, so that the values that share the same filters will repeat and show the same sum.

GreenKnight1294_1-1689971053515.png

Thank you.

 

Hi @GreenKnight1294 
Unfortunately, I don't know how it works in power pivot.
In power bi to achieve your goal you can add a calculated column with Dax formula :

test = if([Registry]="2290"&&'Table (2)'[Type]="print",CALCULATE(sum('Table (2)'[QTY]),ALLEXCEPT('Table (2)','Table (2)'[Registry],'Table (2)'[Type])),'Table (2)'[QTY]).
Ritaf1983_0-1689971736427.png

I also updated a sample file .
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hey, Rita,

 

Sorry I couldn't answer sooner.

 

I tried out your solution and unfortunately this isn't the answer I'm looking for. Your formula is only adding the registries that share "2290" and "print" and I want a formula that can reference one of the columns in the table to get the value "2290" rather than a fixed value.

 

If the row has the value "2290" in the registry column I want it to add all the values that have 2290, but if another row has 2291 I want it to add all the values that have 2291 as well, and so on.

 

Do you know if this is possible using DAX?

 

Thank you so much for your time.

Hi @GreenKnight1294 .

I am sorry , i just not sure i understan what you have vs what you need.

Please share your table un iseful format ( not screenshot)  and desired result. I will try to help 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hey @Ritaf1983 

 

It seems I accidentally replied to the main post and not to you directly. Just wanted to let you know.

 

Thanks.

Hi @GreenKnight1294  on this table my solution works.

I can't figure out what the problem is.

"Fix" a cell in POWER BI is not possible because of the logic it uses

Rather than working at the cell level, it works at the column level.

It's a game where you release filters and apply filters in a context.

Sumifs in the context of multiple conditions is like I showed calculate ([measure], condition A && condition B etc..)

 

Unfortunately, I don't know how to help beyond that...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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