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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Schifo78
Frequent Visitor

Powerbi Sum values and filter results

Hi I'm really struggling with this, I have a series of table rows each represent a project with a value, a client and a status. I'm trying to create a measure which filters clients where the sum of all their projects that have a 'live' status is greater than 50,000 but less than 200,000.  Reason for this is that I want a chart that only has clients whose total value of projects falls within this range. Any help greately appreciated!

 

So the ProjectTable data looks like this:

 

ProjectValueStatusClient



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

Hi @Schifo78 ,

 

Please try the measure.

 

Measure = 
VAR _sum =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLEXCEPT ( 'Table', 'Table'[Client] ), 'Table'[Status] = "live" )
    )
RETURN
    COUNTROWS (
        FILTER ( 'Table', 'Table'[Status] = "live" && _sum >= 50000 && _sum <= 200000 )
    )

vkkfmsft_0-1662604625149.png

 

Best Regards,
Winniz
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
v-kkf-msft
Community Support
Community Support

Hi @Schifo78 ,

 

Please try the measure.

 

Measure = 
VAR _sum =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLEXCEPT ( 'Table', 'Table'[Client] ), 'Table'[Status] = "live" )
    )
RETURN
    COUNTROWS (
        FILTER ( 'Table', 'Table'[Status] = "live" && _sum >= 50000 && _sum <= 200000 )
    )

vkkfmsft_0-1662604625149.png

 

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

Shreeram04
Resolver III
Resolver III

Hi @Schifo78,

 

Please find the below screenshot and image for your reference.

 

Shreeram04_0-1662552376751.png

Measure:  

    Measure 15 = CALCULATE(SUM(Sheet1[Amount]),FILTER(Sheet1,Sheet1[Amount]>40),FILTER(Sheet1,Sheet1[Amount]<90))
 
Total amount =2311 but the value between 40 and 90 is 1182.
 
Did I answer your question? Mark my post as a solution!
 
Thanks,

Hi @Shreeram04 

 

I've just tried your measure and that's giving me the same as what I managed to acheive, that is summing only projects where the value is greater than and less than.

 

E.g.

Its summing 

Client A Project A value 60,000

Client A Project B value 70,000

But not 

Client A Project C value 205,000

 

What I need is to return only Clients that have a total value for all thier projects between those two values, rather than only summing projects that fall between those two values. So in this use case Client A would be filtered out as the total value of thier three projects is above 200,000.

 

Thanks

 

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.

Top Solution Authors