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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculate customers visits frequency

Hi there,

 

I'm new to the forum and DAX and I need some help.

Generally, the problem is that I have a table with 2 fields, Dates and Customers. What do I want to get is a chart showing how many customers are visited 1 time, how many 2 times and etc. Link to the data is here: CustomersVisitsData

CustomersVisits.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thank you in advance.

1 ACCEPTED SOLUTION

@Anonymous

 

File attached here

 

countofvisits.png


Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

If you already have a Count of Visits Column in your Raw Data

 

you can simply put it in the X - Axis and put the count of count of Visits as Values

 

Please see the attached file

 

If you dont have this column, you can use this calculated column

 

Count of Visits =
IF (
    [DATE_OF_VISIT]
        = MINX (
            FILTER ( Table1, [Customer Name] = EARLIER ( [Customer Name] ) ),
            [DATE_OF_VISIT]
        ),
    CALCULATE (
        COUNT ( Table1[DATE_OF_VISIT] ),
        ALLEXCEPT ( Table1, Table1[Customer Name] )
    )
)

 


Regards
Zubair

Please try my custom visuals

@Anonymous

 

File attached here

 

countofvisits.png


Regards
Zubair

Please try my custom visuals

Hi Zubair,

How can I create a measure instead of inserting a new column? I tried to modify the code but it didn't work.

Thanks for your help in advance!

Anonymous
Not applicable

Thank you. That's great. Really appreciate you help. Smiley Happy

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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