Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Add new column based on current row values, using multiple filters

Hi there   I am new to Power BI and I am still learning how to use DAX.   I want to add a calculated column which uses multiple filters based on a value taken from the current column. My purpose ...
  • mahoneypat's avatar
    5 years ago

    Here is a calculated column expression that returns your desired result.  FYI that you could also do this as a measure instead.

     

    Last Month Value New =
    VAR lastmonth = 'PBI Risk Project'[Dates LastMonth]
    RETURN
        CALCULATE (
            SUM ( 'PBI Risk Project'[Value] ),
            ALLEXCEPT (
                'PBI Risk Project',
                'PBI Risk Project'[Project Name],
                'PBI Risk Project'[ID]
            ),
            'PBI Risk Project'[Dates Month] = lastmonth
        ) + 0
    

     

    Regards,

    Pat