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
mariobandeira
Regular Visitor

How to have a running total at any point in time with Dax and Power BI

How do i list running bank balances ate any point in time? I do have data throught out the year but when i select a specific date in time it shows online banks with values in that specific day, i would like to list even those with no data in that day. It should show the values acummulated even when there is no values for that day.

----

Account Balance =
          VAR minDate = CALCULATE( MIN ('Nova Tesouraria'[DTMOV]),
          ALLSELECTED( 'Nova Tesouraria'[DTMOV] )
)
RETURN
CALCULATE(
     [Saldo Acumulado],
     FILTER(
            ALL( 'Nova Tesouraria'[DTMOV] ),
           'Nova Tesouraria'[DTMOV] >= minDate
           && 'Nova Tesouraria'[DTMOV] <= MAX( 'Nova Tesouraria'[DTMOV] )
     )
)
/*
[Saldo Acumulado] is a MEASURE
*/
MY DATA
----
DEBITOCREDITOSALDOCONTADTMOV
060000-60000BFA2019-02-04 00:00:00.000
120000-48000BFA2019-05-04 00:00:00.000
200000001952000BFA2019-06-04 00:00:00.000
0712501880750BFA2019-12-21 00:00:00.000
141900003299750BFA2020-02-08 00:00:00.000
602838,50602838,5BIC2019-12-08 00:00:00.000
041040561798,5BIC2020-01-09 00:00:00.000
215000002711799BIC2020-03-08 00:00:00.000
200000002000000BPA2019-04-04 00:00:00.000
01900001810000BPA2019-05-04 00:00:00.000
36550002175500BPA2019-11-08 00:00:00.000
0720002103500BPA2020-02-09 00:00:00.000
0108000-108000CXAKZ2019-03-04 00:00:00.000
180600-89940CXAKZ2019-03-25 00:00:00.000
80920-81848CXAKZ2019-04-04 00:00:00.000
5375000455652CXAKZ2019-10-08 00:00:00.000
03420452232CXAKZ2019-12-14 00:00:00.000
86000001312232CXAKZ2020-01-08 00:00:00.000
2952601341758CXAKZ2020-04-09 00:00:00.000

 

RESULT
-----
Resulta of the codeResulta of the codeDesired ResultDesired Result
 
2 REPLIES 2
lbendlin
Super User
Super User

your sample data is missing the date column. Please add that and paste as a table, not an image.

Hi, i did add the table with data. Thanks for the reply

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.