cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PoweBI Member
Member

SUMIF in Power BI

How to use =SUMIFS for below table in power bi.

=SUMIFS(PRIOR MONTHS,REGION,SALES REGION,UI,PID)

 

Prior Months

Region

Sale Region

UI

PID

0

Europe

Europe

ABC

ABC

12

Europe

Europe

XYZ

XYZ

12

Europe

Europe

OPQ

OPQ

2.5

Americas

Americas

LKM

LKM

2.5

Americas

Americas

PKR

PKR

2.5

Americas

Americas

JKL

JKL

2.5

Americas

Americas

GUJ

GUJ

2.5

Americas

Americas

RAJ

RAJ

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-yulgu-msft
Microsoft

Re: SUMIF in Power BI

Hi @PoweBI,

 

You can create a measure similar to below:

SumValue =
CALCULATE (
    SUM ( Table[PriorMonths] ),
    FILTER (
        ALLSELECTED ( Table ),
        SELECTEDVALUE ( Table[Region] ) = "Europe"
            && SELECTEDVALUE ( Table[SaleRegion] ) = "Europe"
            && SELECTEDVALUE ( Table[UI] ) = "ABC"
            && SELECTEDVALUE ( Table[PID] ) = "ABC"
    )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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
Super User IV
Super User IV

Re: SUMIF in Power BI

Generally SUMIF means that you are summing based upon some condition. The general replacement for SUM if is to use a CALCULATE with a SUM and a FILTER.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

AlexisOlson Member
Member

Re: SUMIF in Power BI

You can also use a SUMX along these lines

 

SUMX(
    FILTER(
        Table1,
        <Conditions Here>
    ),
    Table1[Column to Sum]
)
Microsoft v-yulgu-msft
Microsoft

Re: SUMIF in Power BI

Hi @PoweBI,

 

You can create a measure similar to below:

SumValue =
CALCULATE (
    SUM ( Table[PriorMonths] ),
    FILTER (
        ALLSELECTED ( Table ),
        SELECTEDVALUE ( Table[Region] ) = "Europe"
            && SELECTEDVALUE ( Table[SaleRegion] ) = "Europe"
            && SELECTEDVALUE ( Table[UI] ) = "ABC"
            && SELECTEDVALUE ( Table[PID] ) = "ABC"
    )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

PoweBI Member
Member

Re: SUMIF in Power BI

thank yo so much Yuliana.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors