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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Summary Table

Hi,

 

I have a table with Columns LoanID, Status, StatusID, LoanRemaining Balance, Accrual Date, Days Past Due which has records for every date. I want to have a summarized table having the max accrual date in each month and the year and its corresponding days past due and loan remaining balance for loans having status id as 100 and 1001

 

Below is where you can see the dataset and the result table,

 

https://drive.google.com/drive/folders/1kUJEzxtkH40lzd3h4FvOuysf9JPo8_FS?usp=sharing

 

The sql query used is,

 

select loan_id, loan_status, status_id,loan_remaining_balance, max(accrual_date) as maxdate, days_past_due from accrualtable
where
status_id in (100, 1001) 
group by loan_id, year(accrual_date), month(accrual_date)
order by maxdate, status_id;

 

 

Please Help me write DAX query for it!

 

@Ashish_Mathur 

 

Thanks,

Dharani

 

 

1 ACCEPTED SOLUTION

All the answers on your result worksheet are wrong.  Download my PBI solution file from here.

Hope this helps.

Untitled.png


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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Thank You so much Sir

You are welcome.


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

Hi,

In the Dataset worksheet, the entry in the Days past due column in row 5 is -28  In the Result worksheet, then entry in the  Days past due column in row 2 is -31.  Why this discrepancy?


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

Sorry sir my mistake. I guess my query is wrong, the result worksheet in row 2 must have -28

All the answers on your result worksheet are wrong.  Download my PBI solution file from here.

Hope this helps.

Untitled.png


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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.