Forum Discussion

shanipowerbi's avatar
shanipowerbi
Helper III
5 years ago
Solved

Need Point in Time Last Invoice Amount

Hi Experts

 

I need your urgent help, I have two tables 1 - Active Users (Servers) 2 - Invoice Data

Active Users (Servers)
DateUser ID
Feb-20126389
Feb-20126611
Mar-20126389
Mar-20126611
Apr-20126389
Apr-20126611
May-20126389
May-20126611
Jun-20126389
Jun-20126611
Jul-20126389
Jul-20126611
Aug-20126389
Aug-20126611
Sep-20126389
Sep-20126611

 

Invoice Data
DateUser IDInvoice Amount
Jan-20126389 $  10
Feb-20126389 $ 15
Feb-20126611 $ 10
Mar-20126389 $ 20
Mar-20126611 $ 20
Apr-20126389 $ 25
Apr-20126611 $ 30
May-20126389 $ 30
May-20126611 $ 40
Jun-20126389 $ 35
Jun-20126611 $ 50
Jul-20126389 $ 40
Jul-20126611 $ 60
Aug-20126389 $ 45
Aug-20126611 $ 70
Sep-20126389 $ 50
Sep-20126611 $ 80

 

Both tables are separate the result I need the amount in a 

 

Event Date
DateUser IDPoint of Time Invoice Last Invoice
Feb-20126389 $10.00
Feb-20126611 $0  
Mar-20126389 $15.00
Mar-20126611 $10.00
Apr-20126389 $ 20.00
Apr-20126611 $20.00
May-20126389 $25.00
May-20126611 $30.00
Jun-20126389 $30.00
Jun-20126611 $40.00
Jul-20126389 $35.00
Jul-20126611 $50.00
Aug-20126389 $40.00
Aug-20126611 $60.00
Sep-20126389 $45.00
Sep-20126611 $70.00

 

  • vpanchu's avatar
    vpanchu
    5 years ago

    Step 1---Create a bridge table with unique user id

     

     

    Step 2 --Create a calculated colum in the Active user table 

    Pending Invoice last month =
         LOOKUPVALUE('Invoice data'[Invoice Amount],
             'Invoice data'[Date],DATEADD('Active User'[Date],-1,MONTH)
    )
     
     
    Step3----pull the highlighted fields in a table
     
     

    ā€ƒ

     
     

     Note: it is not showing  the Feb value for user 126389 because there is no data in the active user table , you can work on the source , but hope you got the context.

     

    Rergards

    Vpanchu 

     

     
     

9 Replies

  • mhossain's avatar
    mhossain
    Solution Sage

    shanipowerbi 

     

    Create a calculated column in your "Active user" table as below:

     

    Point of Time Invoice Last Invoice=

    LOOKUPVALUE(Invoice_Data[Invoice Amount],Invoice_Data[Date],DATEADD(Active_Users[Date],-1,MONTH))

     

    Make sure you have created relationship between the tables on the userID.

     

    Please let me know if this solves.

    • shanipowerbi's avatar
      shanipowerbi
      Helper III

      Thanks for the help, how can I make the relationship as you can see both tables have multiple User IDs of the same User.