Forum Discussion

mohd89ali's avatar
mohd89ali
Frequent Visitor
6 years ago
Solved

Create a table from filtered data from another tables

Hi all, 

 

I have a few tables that I work with. I want to create a table from filtered data from different tables. 

for example, I have these values in these tables: 

 

account_move_line

dateaccount_idbalance 
01/01/201159
01/02/202145
01/03/203651
01/03/20312
01/04/204354
01/05/201365
01/06/202168
01/07/203325
01/08/204654
01/09/201138
01/10/202264
01/11/203-12
01/12/2045

 

I started by, Table = VALUES(account_move_line[date]) now I have the date in the first column. 

in the second column, I want to have the balance filtered by the account_ id 1. 

and in the third column, I want to have the balance filtered by sum of account_id=2 plus id=3. 

 

to look like something like this

datebalance1balance2
01/01/201590
01/02/20 145
01/03/200663
01/04/200 
01/05/200 
01/06/20365 
01/07/200168
01/08/200325
01/09/200 
01/10/20138 
01/11/200264
01/12/200-12

 

 

 how can I create these columns? 

 

 

 

 

 

  • Hi mohd89ali ,

     

    Please try to create two measures like this:

    Balence 1 = 
    CALCULATE (
        SUM ( account_move_line[balance ] ),
        FILTER (
            account_move_line,
            account_move_line[account_id] = 1
                && account_move_line[date] = MAX ( 'Table'[date] )
        )
    )
    
    Balence 23 = 
    CALCULATE (
        SUM ( account_move_line[balance ] ),
        FILTER (
            account_move_line,
            account_move_line[account_id] IN { 2, 3 }
                && account_move_line[date] = MAX ( 'Table'[date] )
        )
    )
    

     

    For more details, please see the attachment.

     

1 Reply

  • v-xuding-msft's avatar
    v-xuding-msft
    Community Support

    Hi mohd89ali ,

     

    Please try to create two measures like this:

    Balence 1 = 
    CALCULATE (
        SUM ( account_move_line[balance ] ),
        FILTER (
            account_move_line,
            account_move_line[account_id] = 1
                && account_move_line[date] = MAX ( 'Table'[date] )
        )
    )
    
    Balence 23 = 
    CALCULATE (
        SUM ( account_move_line[balance ] ),
        FILTER (
            account_move_line,
            account_move_line[account_id] IN { 2, 3 }
                && account_move_line[date] = MAX ( 'Table'[date] )
        )
    )
    

     

    For more details, please see the attachment.