Forum Discussion
A Common Modelling Scenario That Got Me Stumped
- 1 year ago
For REQ1 you could add any fields you wanted to display into the fact table, e.g. Arrival Name, Dest Name, Arrival Code, Dest Code.
For filtering the measures you could have a single, disconnected, airports table and create a calculation group with a calculation item like
Airport Filter = VAR SelectedAirports = VALUES ( Airports[Code] ) VAR Result = CALCULATE ( SELECTEDMEASURE (), KEEPFILTERS ( 'Fact'[Arrival Code] IN SelectedAirports || 'Fact'[Destination Code] IN SelectedAirports ) ) RETURN ResultUse this as a filter on any visuals where you want that behaviour, or potentially as a report level filter if you want it everywhere.
Thanks for the recommendation John T. Although having the airport address in the fact table won't be recommended as in my case, the address is a large set of characters and modelling that in the fact table may hurt performance.
i have gone ahead with my third option but created a connected locations table to both a origin airport table and destination airport table with an inactive relationship to the destination airport table. I would have to explicitly create specific measures by location that is cross filtered to the locations table.