Forum Discussion
BKnecht
10 years agoKudo Kingpin
DAX 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")
)
Willborn
9 years agoAdvocate III
Hi there
Thanks for this solution - it guided me a step further with a filter challange :smileyhappy:
i'm currently struggling with adding multiple filters:
POS Attribut Value 1 A 10 2 B 200 3 C 3000 4 D 40000 5 E 500000 6 A 10 7 B 200 8 C 3000 9 D 40000 10 E 500000
I summed the total of all SAP[Value] where [Attribute] is "A":
Total_AB = CALCULATE(SUM(SAP[Value]); FILTER( SAP; SAP[Attribut] = "B") )
But I need to Sum the total of all SAP[Value] where [Attribute] is "A", "B" and "E" - but the filter functions allow only 2 statements. Does someone has an idea how to solve this with DAX?
Thx! Patrick
Anonymous
9 years agoNot applicable
Total_ABE = CALCULATE( SUM(SAP[Value]); FILTER( SAP; SAP[Attribut] = "A" || SAP[Attribut] = "B" || SAP[Attribut] = "E" ) )