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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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]) ))

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]) ))

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Kudoed Authors