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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.