Forum Discussion
Anonymous
5 years agoNot applicable
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 ...
- 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 ) + 0Regards,
Pat
mahoneypat
5 years agoMicrosoft Employee
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
- Anonymous5 years agoNot applicable
It worked! Thank you very much for your help 🙂
If I use a similar expression in a measure it will work as well or it needs to be written differently?