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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Dbertelsen
Frequent Visitor

Count of registered users - monthly and accumulated

Hi everyone,

 

So, I have a bit of a conundrup here that I can't seem to solve on my own, so I truly hope that somebody can help me figure out a solution.

 

Basically, I have the data for users (customers) who has registered with a website.

The data contains the following:

- Registration date

- Unique user ID

- User name

 

Examples:

 

Registration dateUnique user IDUser name
18/10/2022

sa3h21as3dh

John Smith
13/09/202213gasd35g1asAdam
14/08/2022asd3g51sJon Snow
21/07/2022dg1a6s3d8Karen
19/06/2022hdf684dssgPeter Parker
11/05/2021q4sd6ds8g4sAlex

 

 

In my actual data, I have 800+ user registrations like the onces above, which I would like to have show:

- Registerations monthly

- Total accumulated registrations monthly

 

Now, here comes the most tricky part (if you ask me):

I also need the accumulated total for a given month, to be cross-referenced with the total orders made for the same given month.

 

Much like the data above, we have the same data for orders, looking somewhat like this:

Order dateUnique user IDUser name
19/11/2022

sa3h21as3dh

John Smith
19/10/2022sa3h21as3dhJohn Smith
16/08/2022asd3g51sJon Snow
25/07/2022dg1a6s3d8Karen
21/06/2022hdf684dssgPeter Parker
17/05/2021q4sd6ds8g4sAlex

 

As you can see, a user can be "active" every month, by coming back and making a new purchase/order.

In this example above, you can see that John Smith has made an order in both Oct. and Nov. -> thus, John Smith has been active in both Oct. and Nov.

 

So, my ultimate goal here is to get to the following insights:

- Total orders per month (all distinct orders) -  ☑️ (done)

- Total users active (made an order) pr month - ☑️ (done)

- Total users registered (accumulated) up until selected month - how? 🤔

 

 

 

5 REPLIES 5
Dbertelsen
Frequent Visitor

I have an excel file with the data.

Unfortunately I dont think its possible to share/attach excel files to posts here on the forum, right?

 

The file contains 2 sheets

  • Orders
    • OrderDate
    • OrderID
    • OrderAmount (in EUR)
    • UserID

  • Users
    • UserID
    • RegisteredDate

Ultimately, the data basically shows the orders and which user placed it.

It also shows when users registered their profile.

 

What I need to get to, is to have the following data

  1. Rolling total distinct users (Accumulated registered users (monthly))
  2. Total distinct users who had an order in month X (monthly)
  3. Total distinct users who had an order in month X vs. total accumulated users (so for instance, if I want to see the numbers for September, then it will show me the distinct count of users who had an order in September vs. the total accumulated registered users since up until and including September).
  4. How many distinct users that had an order as a percentage of the total accumulated registered users (monthly).

 

Ideally this is the graph that I want to be able to produce in PowerBI 😂

I can easily do it in Excel, but I have zero luck doing it in PowerBI.

 

Active users.png

 

 

FreemanZ
Super User
Super User

Try to create a measure with the code below:
 
UserAccum := 
VAR CurrentDate = MAX (UserTable[RegistrationDate])
COUNTROWS(
    FILTER(
        ALL(UserTable[ID]),
        UserTable[RegistrationDate]>= CurrentDate
)

Hmm.. for some reason it's not working for me?


UserAccum =
VAR CurrentDate = MAX(PowerBI_Practitioners[RegisteredDate]
COUNTROWS(
    FILTER(
        ALL(PowerBI_Practitioners[PractitionerId],
        'PowerBI_Practitioners'[RegisteredDate]>= CurrentDate
)


I get the following error message:
The syntax for 'COUNTROWS' is incorrect. (DAX(VAR CurrentDate = MAX(PowerBI_Practitioners[RegisteredDate]COUNTROWS( FILTER( ALL(PowerBI_Practitioners[PractitionerId], 'PowerBI_Practitioners'[RegisteredDate]>= CurrentDate ))).
Shaurya
Memorable Member
Memorable Member

Hi @Dbertelsen,

 

You can use:

 

Count = CALCULATE(DISTINCTCOUNT('Table'[Unique User]),FILTER('Table',MONTH(Order Date)<=MONTH(SELECTEDVALUE('Filter'[Date]))))

 

Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI

For some odd reason, this just returns the value "3" 😂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.