Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Cross FIlter issue in SSAS version 2019

I have a data model with Fact Table 1 and Fact Table 2, and I need to establish a many-to-many relationship where Fact Table 1 filters Fact Table 2. I'm using SSAS version 2019 with compatibility lev...
  • v-csrikanth's avatar
    1 year ago

    Hi Anonymous 
    Thanks for the suggestion! The approach shared by Anonymous  seems to be quite efficient.

    Additionally few points are are below
    In SSAS 2019 (compatibility level 1500), the CROSSFILTER function does not support one-way filtering (left-to-right only) like it does in Power BI models. The CROSSFILTER direction must be either 'Both' or 'None'—OneWay is not a valid argument in SSAS Tabular models as of that version.

    Here’s how you can handle this scenario:

    • Use a bridge table between Fact Table 1 and Fact Table 2, and establish one-to-many relationships from each fact table to the bridge table.

    • Write a DAX measure that explicitly filters Fact Table 2 based on the selections in Fact Table 1 via the bridge.

    Filtered Measure =
    CALCULATE(
    [Some Measure from Fact2],
    TREATAS(VALUES(Fact1[Key]), BridgeTable[Key])
    )

     

    This way, even though the relationship isn't enforcing direction automatically, you simulate one-way filtering usin

    TREATAS.

    If you're trying to achieve this behavior inside a calculated column or calculated table, then you'll need to redesign your logic to work within the row context or use measures instead.

    Best Regards,
    Cheri Srikanth