Forum Discussion
Reverse cumulative histogram
I have a table containing user activity logs for a website.
Each row in the table represents a user visiting a specific page on the website.
| UserId | PageId |
| A | 1 |
| A | 2 |
| B | 1 |
| C | 2 |
| C | 1 |
| C | 2 |
In the dummy table above, User A has visited 2 distinct pages, B has just visited 1 page and C has visited 2 distinct pages (they visited the same page twice).
I would like to make a reverse cumulative histogram showing how many users have viewed "X or more" number of pages.
The X-axis should have the following custom values:
- 1+
- 2+
- 3+
- 6+
- 11+
- 15+
and the corresponding bar at each point on the X-axis should represent the number of users with that many page views or more.
For example, using the dummy data above, we have 3 users with 1+ pages viewed and 2 users with 2+ pages viewed.
Hi Anonymous ,
Create a table with the following format to use on your x-axis:
Count Minimum value 1+ 1 2+ 2 3+ 3 6+ 6 11+ 11 15+ 15 Now add the following measure to your model:
Count Pages = COUNTROWS ( FILTER ( SUMMARIZE ( ActivityLogs; ActivityLogs[UserId]; "@PageViews"; DISTINCTCOUNT ( ActivityLogs[PageId] ) ); [@PageViews] >= SELECTEDVALUE ( 'AxisTable'[Minimum value] ) ) )Check PBI file attach.
1 Reply
- MFelix
Super User
Hi Anonymous ,
Create a table with the following format to use on your x-axis:
Count Minimum value 1+ 1 2+ 2 3+ 3 6+ 6 11+ 11 15+ 15 Now add the following measure to your model:
Count Pages = COUNTROWS ( FILTER ( SUMMARIZE ( ActivityLogs; ActivityLogs[UserId]; "@PageViews"; DISTINCTCOUNT ( ActivityLogs[PageId] ) ); [@PageViews] >= SELECTEDVALUE ( 'AxisTable'[Minimum value] ) ) )Check PBI file attach.