Forum Discussion

101Mathew's avatar
101Mathew
Advocate V
4 years ago
Solved

Best Practice to filtering Fact Table (by FactTable column value)

Hi All,   Please could I ask for some guideance.   I have a fact table with say 2m rows of data - I need to return the count of rows when the fees are not equal to zero and the transaction type i...
  • AlexisOlson's avatar
    4 years ago

    It's almost always better to filter on columns rather than tables whenever possible. So I'd recommend something more like this:

    Test # of Units with Fees =
    CALCULATE (
        COUNTROWS ( 'fFactTable' ),
        'fFactTable'[Admin Fee] <> 0,
        KEEPFILTERS (
            TREATAS ( { "New Business", "Renewal" }, 'dransType'[GroupedTranType] )
        )
    )