Forum Discussion

Badger43's avatar
Badger43
Frequent Visitor
4 years ago
Solved

Filter Context / Transition Help

I've been using Power BI for a while and as a non technical user have more recently started studying DAX and context transition in greater detail.  I feel I am making progress but am stumped by the f...
  • OwenAuger's avatar
    4 years ago

    Hi Badger43 

    The measure you have written is one version of a related distinct count measure.

    See here for a similar example:

    https://www.daxpatterns.com/related-distinct-count-excel-2013/

    The important concept here is "expanded tables". Providing Expense as a filter argument actually adds the expanded Expense table as a filter, which includes columns of all tables on the 1-side of a relationship with Expense, so includes all columns of Accounts.

     

    The result is that rows of Accounts related to the visible rows of Expense become filters, and [NoofAccounts] gives the expected result.


    This is a good article on expanded tables:

    https://www.sqlbi.com/articles/expanded-tables-in-dax/

     

    Regards,

    Owen