Forum Discussion

salmankhan_hm's avatar
salmankhan_hm
Frequent Visitor
3 years ago
Solved

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...
  • Jihwan_Kim's avatar
    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