Forum Discussion
Anonymous
6 years agoNot applicable
DAX Measure With Multiple FILTERS
I'vw been grappling with how to write the DAX for a measure tht has a column that needs multiple filters. Here is my current DAX for the measure in question: Booked Total Pax Legs:=CALCULATE( SUM...
OwenAuger
Super User
6 years agoHi Anonymous
Generally it's best to apply filters to columns rather than entire tables.
In your case you have filters to apply DimFlightLeg[OperatorCode] and DimFlightLeg[Flight as a Number].
I would rewrite your measure something like this:
Booked Total Pax Legs :=
CALCULATE (
SUM ( FactPassengerLeg[PassengerLegUnit] ),
DimFlightLeg[OperatorCode] = "SY",
DimFlightLeg[Flight as a Number] < 8000
&& NOT ( DimFlightLeg[Flight as a Number] >= 1000
&& DimFlightLeg[Flight as a Number] <= 1099 )
)If you need these filters to be be intersected with existing filters, you could wrap each filter argument in KEEPFILTERS.
Regards,
Owen