Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Hierarchy Account Filters for General Ledger Table

Dear PBI users...   So I have about 250 unique AccountIDs and each of them is marked from 1-4 (based on what the account is for).   50 of these accounts are made up of the others. That is, 50 acc...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Anonymous,

     

    According to your description, you want to use key account to get the subaccount and the sub total amount, right?

    If as I said, you can refer to below steps to get the sub account and the sub total:

     

    Tables.
    Parent table:

     

     

     

    Detail table:


     

    Measure:

    Sub Accounts =
    CONCATENATEX(FILTER(Sheet2,Sheet2[Parent]=MAX(Sheet1[ID])),[Account ID]&",")

     

    Other way, use relationship:
     
    Sub Accounts 2 = CONCATENATEX(FILTER(Sheet2,Sheet2[Parent]=RELATED(Sheet1[ID])),[Account ID]&",")

     

    Subtotal = SUMX( FILTER(Sheet2,Sheet2[Parent]=MAX(Sheet1[ID])),[Amount])

     

    Create visuals:

    Table visual.
     

     

    Slicer.
     

     

    Result.
     

     

    Regards,
    Xiaoxin Sheng