March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi guys,
I created a matrix (screenshot below is a sample):
Basically "1" & "0" here are for determining the status of the customer: If customer bought something in a month, I marked them as Active ("1"). For this purpose, I used the function:
if([MonthlyPrice] > 0 , 1, 0)
Now, I want to create a new measure: if they are "Active" over the last 3 months (current month, previous month & the month before previous month), I mark them as "Returning" customers. I would like the table to calculate this new status every month for e.g. if we are looking at Dec 2015, the status be based on Oct-15, Nov-15 & Dec-15 and so on. However, I don't know if we can reference the cutomer's "Active" status for previous months. I just wonder if we can use DAX to do something like that?
Any help/insight will be really appreciated! Thank you!
Henry
Solved! Go to Solution.
I think I found the solution for this: I created a date column based on [Month] & [Year]; then I calculate the moving sum of "Active" status over the last 3 months for each row using the DATESINPERIOD() function. The matrix was just an end result. Thank you for very useful discussion on:
https://community.powerbi.com/t5/Desktop/Moving-Average/m-p/43041#M16519
I think I found the solution for this: I created a date column based on [Month] & [Year]; then I calculate the moving sum of "Active" status over the last 3 months for each row using the DATESINPERIOD() function. The matrix was just an end result. Thank you for very useful discussion on:
https://community.powerbi.com/t5/Desktop/Moving-Average/m-p/43041#M16519
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
57 | |
52 |
User | Count |
---|---|
197 | |
133 | |
107 | |
69 | |
65 |