Forum Discussion
Merging 2 tables several dates to one date
I have 2 tables I need to merge.
The first table looks like this
| Page path | Date visited | Event Category | Event Action | Event Label | Total Events |
| www.xxx.com | 9-1-22 | Outbound Link | click | ABC | 2 |
| www.xxx.com | 9-1-22 | Non Outbound Link | click | DEF | 1 |
| www.hhh.com | 9-1-22 | Outbound Link | click | GHI | 3 |
| www.xxx.com | 9-2-22 | Outbound Link | click | JKL | 1 |
It needs to be merged with a table like this:
| Page Path | Date Visited | Pageviews |
| www.xxx.com | 9-1-22 | 25 |
| www.hhh.com | 9-1-22 | 10 |
| www.xxx.com | 9-2-22 | 5 |
My issue comes when trying to get the total pageviews number. After the merge, for page path www.xxx.com, the total pageviews for the date 9-1-22 would be 50 instead of 25 since there are 2 different kinds of event categories. I need the sum of pageviews to only sum one pageview number per date per page path, so the total should really be 25.
I hope this made sense. Any help would be appreciated.
Thank you!
3 Replies
- parry2k
Super User
Anonymous after you merge, you can use following DAX measure to sum the page views
Page Views Measure = SUMX ( SUMMARIZE ( Table, Table[Page Path], Table[Date Visited], "@MaxPageViews", MAX( Table[Page Views] ), [@MaxPageViews] )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- AnonymousNot applicable
This almost worked! I guess I didn't specify that each event category/action/label is associated with a specific client name which is within the event label. So if I filter the table by client, it doesnt count the pageviews for that day if the client didnt have any associated events. I need the pageviews to always be the same for an entire date range even if there were no events. Any ideas?
Thank you so much!
- v-luwang-msft
Community Support
Hi Anonymous ,
Not quite sure what you are looking for, can you provide a sample to clarify what you are looking for?
Best Regards
Lucien