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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ryan25r9
Helper I
Helper I

Exclude overlapping results when adding measures together

I feel like I'm missing something simple, but is there a way to exclude overlapping values when you add measures together?

 

For example, if I have two separately defined measures:

Customer Hours:= CALCULATE([Hours], Table[Customer] = "Y")

Billable Hours:= CALCULATE([Hours], Table[Billable] = "Y")

 

& I want to add them together, how do I have the total not duplicate overlapping values where a line is both Customer and Billable?

 

This doesn't appear to work: CALCULATE([Customer Hours] + [Billable Hours])

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @ryan25r9 

 

Based on your description, I created data to reproduce your scenario.

Table:

b1.png

 

You may create a measure as below.

 

Result = 
CALCULATE(
    SUM('Table'[Hours]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Customer Hours] = "Y"
    )
)+
CALCULATE(
    SUM('Table'[Hours]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Billable Hours] = "Y"
    )
)-
CALCULATE(
    SUM('Table'[Hours]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Customer Hours] = "Y"&&
        'Table'[Billable Hours] = "Y"
    )
)

 

 

Result:

b2.png

 

Best Regards

Allan

 

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-alq-msft
Community Support
Community Support

Hi, @ryan25r9 

 

Based on your description, I created data to reproduce your scenario.

Table:

b1.png

 

You may create a measure as below.

 

Result = 
CALCULATE(
    SUM('Table'[Hours]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Customer Hours] = "Y"
    )
)+
CALCULATE(
    SUM('Table'[Hours]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Billable Hours] = "Y"
    )
)-
CALCULATE(
    SUM('Table'[Hours]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Customer Hours] = "Y"&&
        'Table'[Billable Hours] = "Y"
    )
)

 

 

Result:

b2.png

 

Best Regards

Allan

 

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

Ashish_Mathur
Super User
Super User

Hi,

Assuming Hours is a measure calculated from a column in the 'Table' Table itself, write this measure

Measure = CALCULATE([Hours],Table[Billable] ="Y",Table[Customer] ="Y")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@ryan25r9, Try OR and AND depend on need

Customer Hours:= CALCULATE([Hours], filter(Table,Table[Customer] = "Y" || Table[Billable] = "Y"))
Customer Hours:= CALCULATE([Hours], filter(Table,Table[Customer] = "Y" && Table[Billable] = "Y"))
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
VijayP
Super User
Super User

=Calculate( sum([Hours]),

                 Filter(All[Tablename], 

                           Table[Customer] = "Y" &&

                           Table[Billable] = "Y"))

 

 

Try this and let me know if your problem is sorted out.

If this is the answer for you , please mentioned this is a soltuion and give me Kudos

I have posted many videos related to this kind of issues  where you can watch www.youtube.com/perepavijay

Thanks

                                     

          




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.