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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
FOXYBARK
Helper II
Helper II

Simple SumIfs in PBI

HI Team. 

I appreciate the help in advance. 

I would like to replicate a SUMIFS function in PBI. My sample data is shown below. In the example, my answer would be 6. I would like a new column to list the SUMIFS value for all rows in my real table. How can I achieve this in PBI? I am slightly familiar with the GROUP BY button in Power Query but I want to keep my original table in tact. 

Thanks, FB

FOXYBARK_0-1663264673718.png

 

2 ACCEPTED SOLUTIONS
AnthonyJoseph
Resolver III
Resolver III

Hi @FOXYBARK , can you try this (calculated column):

 

AnthonyJoseph_0-1663266973917.png

 

sumif ex = 
CALCULATE(SUM('Table'[Count]),FILTER('Table','Table'[Group] = EARLIER('Table'[Group]) && 'Table'[Party] = EARLIER('Table'[Party])))

 

View solution in original post

v-rzhou-msft
Community Support
Community Support

Hi @FOXYBARK ,

 

Here I suggest you to create a measure as below.

How many from Group B,Party equal to Homecoming = 
CALCULATE (
    SUM ( 'Table'[Count] ),
    FILTER (
        'Table',
        'Table'[Group] = "B"
            && 'Table'[Party] = "Homecoming"
    )
)

Result is as below.

RicoZhou_0-1663580690760.png

 

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

Hi @FOXYBARK ,

 

Here I suggest you to create a measure as below.

How many from Group B,Party equal to Homecoming = 
CALCULATE (
    SUM ( 'Table'[Count] ),
    FILTER (
        'Table',
        'Table'[Group] = "B"
            && 'Table'[Party] = "Homecoming"
    )
)

Result is as below.

RicoZhou_0-1663580690760.png

 

 

Best Regards,
Rico Zhou

 

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

I need an entire column, not a measure. I hit Solved by mistake. 

FB

daXtreme
Solution Sage
Solution Sage

[Your Column] = // calc column
// Don't use CALCULATE in calculated columns
// as this slows down calculations tremendously
// especially on big tables.
var vCurrentParty = T[Party]
var vCurrentGroup = T[Group]
var Output =
    sumx(
        filter(
            T,
            T[Party] = vCurrentParty
            &&
            T[Group] = vCurrentGroup
        ),
        T[Count]
    )
return
    Output
AnthonyJoseph
Resolver III
Resolver III

Hi @FOXYBARK , can you try this (calculated column):

 

AnthonyJoseph_0-1663266973917.png

 

sumif ex = 
CALCULATE(SUM('Table'[Count]),FILTER('Table','Table'[Group] = EARLIER('Table'[Group]) && 'Table'[Party] = EARLIER('Table'[Party])))

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.