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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tangatamanu
New Member

Remaining days per periods of time

Greetings,

 

I'm having trouble trying to calculate the following:

 

I need to calculate the remaining amount for a contract with Start Date, End Date, Current Date, Total Amount and Term, but based on periods of time,

 

For example:

Balance RemainingTotal AmountTotal plus interestTotal Collected% Collected of Total Amount% Collected of plus interestAVG MONTH TERMCurrent $Current %1-10 DAYS NOT PAID $1-10 DAYS NOT PAID %11-20 DAYS NOT PAID $11-20 DAYS NOT PAID %21-30 DAYS NOT PAID $21-30 DAYS NOT PAID %31+ DAYS NOT PAID $31+ DAYS NOT PAID %31+ DAYS NOT PAID % BASED ON TOTAL PLS INTEREST

 

Where 1- 10 days not paid is the amount that a contract is supossed to pay between today and +10, and so on.

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Tangatamanu , what is logic of 1 -0 days.

 

is it based on start date and today like 

 

bucket = datediff([StartDate], Min(Today(), [End Date]), day)

 

then you can create a bucket 

 

Switch(True() ,

[Bucket] <= 10 , "  1 - 10" ,

[Bucket] <= 20 , " 10 - 20" ,

// add others as per need

"GT 20"

)

 

 

Measure would be like 

 

divide(countrows(Table), calculate(countrows(Table), removefilter(Table[bucket]) ))

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Tangatamanu , what is logic of 1 -0 days.

 

is it based on start date and today like 

 

bucket = datediff([StartDate], Min(Today(), [End Date]), day)

 

then you can create a bucket 

 

Switch(True() ,

[Bucket] <= 10 , "  1 - 10" ,

[Bucket] <= 20 , " 10 - 20" ,

// add others as per need

"GT 20"

)

 

 

Measure would be like 

 

divide(countrows(Table), calculate(countrows(Table), removefilter(Table[bucket]) ))

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

Thank you @amitchandak, even though i realize that i didnt explain myself clearly when i was trying to write my problem, what you posted answers my question completly!

 

Cheers

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.