Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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:
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.
Solved! Go to Solution.
Hi @jamesleslie ,
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @jamesleslie ,
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
128 | |
108 | |
100 | |
64 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |