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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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