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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Accumulated daily interests

Hi, I have the following data:

 

table1.PNG

 

Where the Daily payment = Capital * Daily Rate, and that means the amount of money I need to pay in one day for that client. Ex: For client 1, on Jan 4th I'll have to pay $2.34, on Jan 5th 4.86 and so on.

 

What I would like is to see the accumulated amount for all clients by a certain date. Something like this:

 

table2.PNG

 

 

Ideally, it would be a Measure and not Calculated Column since I would like to filter by clients.

 

Is there any way to do this? My data has around 30k rows and dates go as far as 2015, so making a new column for each date doesn't sound reasonable.

 

Any ideas would be really helpful!!

1 ACCEPTED SOLUTION

@Anonymous

 

Use this MEASURE in TABLE 1

 

Cumulative =
SUMX (
    Table1,
    VAR Minvalue =
        MIN ( Table1[Starting date], SELECTEDVALUE ( Table2[Date] ) )
    VAR Maxvalue =
        MAX ( Table1[Starting date], SELECTEDVALUE ( Table2[Date] ) )
    RETURN
        IF (
            SELECTEDVALUE ( Table2[Date] ) >= Table1[Starting date],
            DATEDIFF ( Minvalue, Maxvalue, DAY ) * Table1[Daily payment]
        )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

7 REPLIES 7
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this MEASURE

 

Measure =
CALCULATE (
    SUM ( TableName[Daily Payment] ),
    FILTER (
        ALL ( TableName[Starting date] ),
        TableName[Starting date] <= SELECTEDVALUE ( TableName[Starting date] )
    )
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Zubair_Muhammad

 

It doesn't seem to work as desired. 


table3.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The measure seems to calculate the Daily interest for one given day. Any advice?

 

Regards,

@Anonymous

 

Could you share your file?

 

See my attached file here

 

It works when I use a dummy data set.

May be I am missing something


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Anonymous

 

Use this MEASURE in TABLE 1

 

Cumulative =
SUMX (
    Table1,
    VAR Minvalue =
        MIN ( Table1[Starting date], SELECTEDVALUE ( Table2[Date] ) )
    VAR Maxvalue =
        MAX ( Table1[Starting date], SELECTEDVALUE ( Table2[Date] ) )
    RETURN
        IF (
            SELECTEDVALUE ( Table2[Date] ) >= Table1[Starting date],
            DATEDIFF ( Minvalue, Maxvalue, DAY ) * Table1[Daily payment]
        )
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Zubair_Muhammad

 

It worked perfectly, thanks a lot!

 

Regards,

@Anonymous

 

See your updated file attached here

 

I deleted the relationship between 2 tables becasue it is of no use

 

1201.png

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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