Forum Discussion
BKnecht
Kudo Kingpin
10 years agoDAX Calculate IF OR Statement
Im pretty new to writing DAX, and am trying to do something that would be simple in excel, but I can't seem to create it in Power BI. I'm trying to create a custom measure that says: Calcula...
- Anonymous10 years ago
CALCULATE(
SUM(Table[Column X]),
FILTER(
Table,
Table[Column A] = "Renewal" ||
Table[Column B] = "Needs Alignment")
)
Anonymous
9 years agoNot applicable
potapthe syntax is the same. You can use parentheses. && is the AND operator, || is the OR operator.
CALCULATE( SUM(TableName[Value]), FILTER( TableName, (TableName[Attribut] <> "E" && TableName[Status] < 4) || (TableName[Attribut] = "B" && TableName[Status] = 3) ) )
vyacheslavg
Helper II
9 years agoIt was really helpful.
You mentioned that this is one of your favourite DAX patterns. Could you please share your post or article with your other favourite DAX patterns?