Forum Discussion
salmankhan_hm
3 years agoFrequent 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 Cre...
- 3 years ago
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
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
salmankhan_hm
3 years agoFrequent Visitor
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 🙂
Jihwan_Kim
3 years agoSuper User
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.