Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hey guys, I need help with this:
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'd like is a daily account of all users existing by that date with their status, something like this (not counted from the data above, just for example):
Date ID Status
2019.01.01 USER1 NEW
2019.01.01 USER2 NEW
2019.01.02 USER2 REGISTERED
2019.01.02 USER1 REGISTERED
2019.01.02 USER3 NEW
2019.01.03 USER3 REGISTERED
2019.01.03 USER1 ACTIVE
2019.01.03 USER4 NEW
2019.01.03 USER2 SUSPENDED
I'd ideally do this in DAX, also ideally for just the last 1 month (there is a daily refresh in the database). I started creating a calendar table for the desired time period and do a join, but it won't work the way intended.
Any ideas? Many thanks in advance!
With your Calendar Table related to your Fact Table, use the Date column from the Calendar Table on rows and ID from your Fact table on columns. Then use the following measure:
Status = VAR __LastMonth = EDATE( TODAY(), -1 ) RETURN IF( AND( MAX( DimCalendar[Date]) >= __LastMonth, HASONEVALUE( Table1[Status]) && HASONEVALUE( DimCalendar[Date])), VALUES( Table1[Status] ))
Will only show statuses and associated ID's that have occured within the last month from the current date:
Final table ( I added another record for april to make sure it was working correctly)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
145 | |
87 | |
66 | |
52 | |
45 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |