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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Sum of column based on two other columns

Hi,

 

I have the following table,

 

pat_idfunded amountstatus
1100Funded
2100Funded
3200Funded
 400Funded
 400Approved
4100Approved
5100Expired

 

I want to calculate a measure LoanFunded which is the sum of funded amount for the records having the pat id and status as funded.

 

I have the following query,

#Loan Funded =
VAR _helpTable =
SUMMARIZE (
    'Table',
    'Table'[LOANS.PAT_ID],
    'Table'[LOANS.FUNDED_AMOUNT]
)
RETURN
if(isnumber(SUMX ( _helpTable, [LOANS.FUNDED_AMOUNT] )),SUMX ( _helpTable, [LOANS.FUNDED_AMOUNT] ), 0)
 
this is returning loan funded amount for all the statuses.. how do i add the condition, sum it only if the status is "Funded"
 
 
Please Help!!
 
Thanks,
Dharani 
2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Drag this measure to a card visual

Measure = calculate(sum(Data[funded amount]),data[pat_id]<>blank,data[status]="funded")

Hope this helps.


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

View solution in original post

Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Measure =
var _table=
FILTER('Table','Table'[pat_id]<>BLANK()&&'Table'[status]="Funded")
return
SUMX(_table,[funded amount])

2. Result:

vyangliumsft_0-1658758853560.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

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  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Measure =
var _table=
FILTER('Table','Table'[pat_id]<>BLANK()&&'Table'[status]="Funded")
return
SUMX(_table,[funded amount])

2. Result:

vyangliumsft_0-1658758853560.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

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,

Drag this measure to a card visual

Measure = calculate(sum(Data[funded amount]),data[pat_id]<>blank,data[status]="funded")

Hope this helps.


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

Hi,

Please check the below picture and the attached pbix file, if it provides the expected result.

 

Untitled.png

 

Loan funded measure: = 
SUMX (
    FILTER ( 'Table', 'Table'[pat_id] <> BLANK () && 'Table'[status] = "Funded" ),
    'Table'[funded amount]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors