Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jamesleslie
Advocate I
Advocate I

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.

UserIdPageId
A1
A2
B1
C2
C1
C2

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.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

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


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

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


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.