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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
salmankhan_hm
Frequent Visitor

New column creation

Hi,

I want to create a column called Final_Balance which takes its first value from another column called Balance. The second value for this new column must be the second value of another called Credit added to the previous value of this column and so on.

Your help will be really appreciated. Thanks

 

salmankhan_hm_0-1682957147171.png

 

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1682962087687.png

 

final Balance CC =
VAR _mindate =
    MIN ( Data[Date] )
VAR _initialbalance =
    MAXX ( FILTER ( Data, Data[Date] = _mindate ), Data[Balance] )
VAR _currentdate = Data[Date]
RETURN
    SUMX (
        FILTER ( Data, Data[Date] <= _currentdate && Data[Date] > 1 ),
        Data[Credit/Debit]
    ) + _initialbalance

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1682962087687.png

 

final Balance CC =
VAR _mindate =
    MIN ( Data[Date] )
VAR _initialbalance =
    MAXX ( FILTER ( Data, Data[Date] = _mindate ), Data[Balance] )
VAR _currentdate = Data[Date]
RETURN
    SUMX (
        FILTER ( Data, Data[Date] <= _currentdate && Data[Date] > 1 ),
        Data[Credit/Debit]
    ) + _initialbalance

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Hi Kim,

Thanks for the help. you did it correctly but when I use the DAX you shared I am not getting the correct values. Please check the below screenshot:

salmankhan_hm_0-1683016862140.png

 

Hi,

Thank you for your message.

The DAX formula that I created was for creating a new column, not a new measure.



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Hi Kim,

 

Thank you so much for the help. I got it now. I have another question if you don't mind. What if there is more than one value for Credit/Debit for the same date?  how can I get the same result for that case? 

Thank you so much 🙂 

Hi, 

Thank you for your message.

If you have a credit amount and a debit amount on the same date, it will produce the result that summarizes all values on the same date, and it shows the same number on the same date. If you have a specific order of the credict and the debit on the same date, the order has to be considered in the DAX formula.

I hope this helps.

Thank you.



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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