Forum Discussion
Adding Rows to a Table from Another Table
I'd like to create an Account Activity table that shows every activity from each account to it. Currently, I have an Account table where it shows only the latest activity. The Account table gets updated on a daily basis. Ideally, I'd like to add the latest account activity from the Account table to the Account Activity table as an individual row.
Example:
- Monday: Account #123 added 3 contacts
- Tuesday: Account #123 added 4 contacts
The Account table in the latest refresh would show the last activity as "added 4 contacts"....I'd like to have the Account Log table show both rows.
Is that possible in Power BI? If so, how?
Thanks!
Nope, I guess with some R code this can be done but I don't think PowerBI is used to write back. You have to work on database end to take care of this.
10 Replies
- v-juanli-msftCommunity SupportHiwhich is the relationship between Account Activity table and the Account table, does they have a key column such as account?As you said, “The Account table in the latest refresh would show the last activity as "added 4 contacts"”, so the example of Monday and Tuesday should show in the rows of Account Activity table, right?Whether we could add rows to a table from another table depends on the table structure. So, if it is convenient for you, please share me screenshots or files to know how the table structure.I also confused by this sentence “I'd like to have the Account Log table show both rows”, does the Account Log table refer to the Account table above?Best RegardsMaggie
- Omar1Frequent Visitor
Thank you for helping out, it's very kind of you!
The relationship between Account and Account Activity tables will be the AccountId.
In the example above, that's what my Account table will look like where the last column is FrienshipLevel.
The problem is that with this table above, the FriendshipLevel changes, but I would like to track each change for each account using Power BI.
For example, if I change Joe Smith's FriendshipLevel from 5 to 13 today....the LastModifiedDate will be today's date and I will lose what the FriendshipLevel was before.
That is where I was hoping the Account Acitivity Table comes in because it would show something like this...
- parry2kSuper User
I guess you have two table account and account activity, bring both to the data model and set relationship on ID between tables.
You can see all the history of selected ID (employee) from your account table.