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")
)
BKnecht
Kudo Kingpin
10 years agoThat was so much easier than I was trying to make it, didn't even know about the Filter function, this worked perfectly, Thank you!
Anonymous
10 years agoNot applicable
CALCULATE(<expression>, FILTER( <table>, <table[column] = condition>)) is probably the most generally useful pattern to learn in DAX. The vast majority of measures I write either follow this pattern or contain a part that follows this pattern.