Forum Discussion

salame's avatar
salame
New Member
1 year ago
Solved

help with dax

I have this dataset: I need to create a sum amount and filter by month such that if the value is blank in that month I get the value of the last previous month that was nonblank.   Loan No Amou...
  • v-karpurapud's avatar
    1 year ago

    Hi salame 
    Thank you for reaching out to Microsoft Fabric Community Forum.

    Try with below DAX:

    Amount_Latest = 
    VAR LastAmount = 
        CALCULATE(
            SUM('loan collaterals'[Outstanding Amount]),
            FILTER(
                ALL('Ultimate Calendar'),
                'Ultimate Calendar'[Year] = MAX('Ultimate Calendar'[Year]) &&
                'Ultimate Calendar'[Month] <= MAX('Ultimate Calendar'[Month])
            )
        )
    RETURN
        IF(
            ISBLANK(SUM('loan collaterals'[Outstanding Amount])),
            LastAmount,
            SUM('loan collaterals'[Outstanding Amount])
        )

     

    If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

     

     

    Thank you.