Forum Discussion
Sridharkrish
3 years agoNew Member
Regarding Max Condition with multiple condition
Hi All, I have a table consisting of name, CRM number and a phase where I need to find the max value of the CRM number. I have three conditions here : I want DAX in PowerBi. If a name has only agre...
- 3 years ago
hi Sridharkrish
try to add a column with this:
MaxValue =VAR _MaxValue1 =CALCULATE(MAX(TableName[CRM]),ALLEXCEPT(TableName, TableName[Name]))VAR _MaxValue2 =CALCULATE(MAX(TableName[CRM]),ALLEXCEPT(TableName, TableName[Name]),TableName[Phase]="Agreement")RETURNIF(_MaxValue2<>0,IF(TableName[CRM]=_MaxValue2, "MAX"),IF( TableName[CRM]=_MaxValue1, "MAX"))i tried and it worked like this:
FreemanZ
3 years agoSuper User
hi Sridharkrish
try to add a column with this:
MaxValue =
VAR _MaxValue1 =
CALCULATE(
MAX(TableName[CRM]),
ALLEXCEPT(TableName, TableName[Name])
)
VAR _MaxValue2 =
CALCULATE(
MAX(TableName[CRM]),
ALLEXCEPT(TableName, TableName[Name]),
TableName[Phase]="Agreement"
)
RETURN
IF(
_MaxValue2<>0,
IF(TableName[CRM]=_MaxValue2, "MAX"),
IF( TableName[CRM]=_MaxValue1, "MAX")
)
i tried and it worked like this:
- Sridharkrish3 years agoNew Member
Thank you very much for your help. It got solved !!