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 August 31st. Request your voucher.

Reply
arp2
Helper II
Helper II

Sum with multiple conditions (sumifs in excel)

Dear All,

 

I am trying to achieve the results as shown here below.....I tried multiple methods using similar old posts but struggled.....Plz help me out.

Table Sample

Employee IDProject NumberHoursWeekDisciplineCriteria
A100P110Wk-1CivilSum-1
A101P16Wk-1CivilSum-1
A102P25Wk-1CivilSum-1
A103P36Wk-1CivilSum-1
A104P48Wk-1PMSum-2
A105P210Wk-1PESum-1
A100P59Wk-1CivilSum-2
A101P55Wk-1CivilSum-2
A102P69Wk-1CivilSum-2
A103P55Wk-1CivilSum-2
A104P78Wk-1PMSum-2
A105P87Wk-1PESum-1
A100P18Wk-2CivilSum-1
A101P18Wk-2CivilSum-1
A102P29Wk-2CivilSum-1
A103P310Wk-2CivilSum-1
A104P410Wk-2PMSum-2
A105P25Wk-2PESum-1
A100P57Wk-2CivilSum-2
A101P55Wk-2CivilSum-2
A102P66Wk-2CivilSum-2
A103P58Wk-2CivilSum-2
A104P78Wk-2PMSum-2
A105P86Wk-2PESum-1

 

Required Result-1 (hours booked only on Project P1, P2, P3 and P8)

DisciplineWk-1Wk-2
Civil2735
PM00
PE1711

 

Required Result-2 (hours booked on Projects except P1, P2, P3 and P8)

DisciplineWk-1Wk-2
Civil2826
PM1618
PE0

0

 

In excel I'm achieving the result as follows:

arp2_0-1669610270991.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @arp2 ,

I have created a simple sample, please refer to it to see if it helps you.

Create 2 measures.

sum_1 =
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Criteria] = "Sum-1"
            && 'Table'[Discipline] = SELECTEDVALUE ( 'Table'[Discipline] )
            && 'Table'[Week] = SELECTEDVALUE ( 'Table'[Week] )
    )
)
sum_2 =
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Criteria] = "Sum-2"
            && 'Table'[Discipline] = SELECTEDVALUE ( 'Table'[Discipline] )
            && 'Table'[Week] = SELECTEDVALUE ( 'Table'[Week] )
    )
)

 

vpollymsft_0-1669688226935.png

I have also created 2 columns, please refer to my pbix file.

 

Best Regards
Community Support Team _ Polly

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
Anonymous
Not applicable

Hi @arp2 ,

I have created a simple sample, please refer to it to see if it helps you.

Create 2 measures.

sum_1 =
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Criteria] = "Sum-1"
            && 'Table'[Discipline] = SELECTEDVALUE ( 'Table'[Discipline] )
            && 'Table'[Week] = SELECTEDVALUE ( 'Table'[Week] )
    )
)
sum_2 =
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Criteria] = "Sum-2"
            && 'Table'[Discipline] = SELECTEDVALUE ( 'Table'[Discipline] )
            && 'Table'[Week] = SELECTEDVALUE ( 'Table'[Week] )
    )
)

 

vpollymsft_0-1669688226935.png

I have also created 2 columns, please refer to my pbix file.

 

Best Regards
Community Support Team _ Polly

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

Thank you so much

amitchandak
Super User
Super User

@arp2 , for except you have to use independent table

 

Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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