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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Vishal_Kumar_R
Frequent Visitor

running total with filter date

Can any one help with dax for filter date and car number should get running total of the person from stating 

example table

NameCar AmountType of debitDateNetDebitCreditBalance
XYZ XX car1000Amount debit21-03-2024 00:051000100001,000.00
XYZ XX car1000Amount debit21-03-2024 00:051000100002,000.00
XYZ XX car160Amount debit21-03-2024 00:0516016002,160.00
XYZ XX car172.36Amount debit21-03-2024 00:05172.36172.3602,332.36
XYZ XX car125Amount debit21-03-2024 00:0512512502,457.36
XYZ XX car12.76Amount debit21-03-2024 00:0512.7612.7602,470.12
XYZ XX car1608.74OnlinePayment21-03-2024 00:05-1608.701608.74861.38
1 ACCEPTED SOLUTION
vivek31
Frequent Visitor

Hi, @Vishal_Kumar_R 

 

try below code for measure

running total = CALCULATE(SUM('Table (4)'[Balance]),
                               FILTER(
                                ALLSELECTED('Table (4)'),
                                'Table (4)'[Date]<=MAX('Table (4)'[Date])))

 

vivek31_0-1711085690400.png

 

All date are same that the reason total balance are same in all row

 


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
vivek31
Frequent Visitor

Hi, @Vishal_Kumar_R 

 

try below code for measure

running total = CALCULATE(SUM('Table (4)'[Balance]),
                               FILTER(
                                ALLSELECTED('Table (4)'),
                                'Table (4)'[Date]<=MAX('Table (4)'[Date])))

 

vivek31_0-1711085690400.png

 

All date are same that the reason total balance are same in all row

 


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Thank you for reply,

 actually there is not balance colume i required a balance colume as a running total so that if it filter a car number automatically it should the balnce from start date to end date as shown in the example but your query will show the same for all the days

 

Dangar332
Super User
Super User

Hi, @Vishal_Kumar_R 

try below code for new column

Column = 
SUMX(
    FILTER(
        ALL('Table (2)'),
         'Table (2)'[Name]=EARLIER('Table (2)'[Name]) && 
         'Table (2)'[Car ]=EARLIER('Table (2)'[Car ]) && 
         'Table (2)'[Date]<=EARLIER('Table (2)'[Date])
    ),
    'Table (2)'[Balance]
)

 

just adjust table name and column name

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors