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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
annekew
Regular Visitor

Summarize how many time x visits

Hi,

I have a dataset with the following columns:
customer_id, date, visits

I want to summarize how many customers visited once, how many customers visited twice, how many customers visited three times, etc. And visualize this in a graph

I want that only the data is included that is selected with the date filter.

So an example with the following data:


customer_iddatevisits
11-1-20241
12-1-20242
13-1-20241
21-1-20241
22-1-20243
33-1-20241
41-1-20241
57-1-20245
63-1-20241


So I want the following outcomes:
For the entire period (1-1-2024 - 7-1-2024): 
1x visited: 2
2x visited: 0
3x visited: 0 
4x visited:2
5x visited:1
6x visted: 0

For the period 1-1-2024 - 2-1-2024:
1x visited: 1
2x visited: 0
3x visited: 1
4x visited:1
5x visited:0
6x visted: 0


2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Power BI does not support dynamic binning. You need to bring your own buckets.  Create a disconnected table with the number of visits, then create a measure to calculate the bucket population for each time period.

 

Your expected result seens to be a little off.

 

lbendlin_0-1733260645558.png

See attached

View solution in original post

v-denglli-msft
Community Support
Community Support

Thanks for the reply from lbendlin, please allow me to provide another insight.
Hi @annekew ,

Please refers to the following steps.
Create a calculated table, derived from the visits column.

vdengllimsft_0-1733283031356.png


The measure is as follows.

Measure = 
VAR result = CALCULATE(COUNTROWS(DISTINCT('Table'[customer_id])), 'Table'[visits]=SELECTEDVALUE('Dimtable'[visits]))
RETURN
IF(result=BLANK(),0,result)

 

The final result is as follows.

vdengllimsft_1-1733283126500.png


Please see the attached pbix for reference.

Best Regards,
Dengliang Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-denglli-msft
Community Support
Community Support

Hi @annekew ,

Is my follow-up just to ask if the problem has been solved?

If so, can you accept the correct answer as a solution or share your solution to help other members find it faster?

Thank you very much for your cooperation!

annekew
Regular Visitor

@lbendlin Thanks! It works! 

Is it also possible to make it interactive with other visuals? Such as that if I select the row with #1 visit, the other visuals also only use the rows of the customers with in total 1 visit

You can use the bucket dimension for a slicer.

v-denglli-msft
Community Support
Community Support

Thanks for the reply from lbendlin, please allow me to provide another insight.
Hi @annekew ,

Please refers to the following steps.
Create a calculated table, derived from the visits column.

vdengllimsft_0-1733283031356.png


The measure is as follows.

Measure = 
VAR result = CALCULATE(COUNTROWS(DISTINCT('Table'[customer_id])), 'Table'[visits]=SELECTEDVALUE('Dimtable'[visits]))
RETURN
IF(result=BLANK(),0,result)

 

The final result is as follows.

vdengllimsft_1-1733283126500.png


Please see the attached pbix for reference.

Best Regards,
Dengliang Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Power BI does not support dynamic binning. You need to bring your own buckets.  Create a disconnected table with the number of visits, then create a measure to calculate the bucket population for each time period.

 

Your expected result seens to be a little off.

 

lbendlin_0-1733260645558.png

See attached

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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