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.
Hey folks, I have data that looks like this:
Date ID Status
2019.01.15 USER1 NEW
2019.01.30 USER1 REGISTERED
2018.11.17 USER2 NEW
2019.01.18 USER2 REGISTERED
2019.01.19 USER3 NEW
2019.01.26 USER3 REGISTERED
2019.01.30 USER3 ACTIVE
2019.03.22 USER3 SUSPENDED
2019.03.24 USER3 ACTIVE
2019.01.24 USER1 ACTIVE
2019.01.25 USER4 NEW
2019.02.26 USER1 SUSPENDED
2019.04.21 USER3 SUSPENDED
What I need is a daily account of all "last statuses". Meaning that I need to be able to tell that on any given day, how many ACTIVE, NEW, REGISTERED, SUSPENDED statuses were there (On any specific date, what was the last status of the users relative to that day, and then do a count).
I wonder if I need to write in all IDs to a table for all the days in the range (2 years and growing) or this can be done dynamically / easier. Later down the road, I will need monthly, quarterly summaries as well on the average values of the status counts.
Any simple way to do this? Much appreciated in advance!
Hi @deuscreator ,
If it is convenient, could you share your desired output so that we could understand your logic better and help further on it?
Best Regards,
Cherry
Hey Cherry,
Thank you for your reply!
Sure, basically, I would like to see the status of each user on each day (last recorded status looking back from that day), and the ability to calculate the aggregate count of the users by each status.
The resulting, aggregated data would be something like this (not actually counted from my example):
Date NEW REGISTERED ACTIVE SUSPENDED
2019.02.12 2 3 10 5
2019.02.13 7 4 9 15
2019.02.14 1 5 22 7
Now, I don't really know whether this would be more practical in PowerQuery or DAX, and I wonder if I make aggregates like this in a separate table, how could I retain the ability to filter still by the user ID (there are many other fact tables that are connected via the user ID). The aim is to create daily snapshots of the whole user base, based on the history of their status changes.
Is it any clearer?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |