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.
New customer: First ever purchase in corresponding fiscal year.
Renewed Customer: Customer purchased in corresponding fiscal year and has made atleast one purchase in the year previous.
Re-activated Customer: Customer purchased in corresponding fiscal year and has made at least one purchase anytime before but not in the fiscal year pirior.
Most solutions online only take into account using either previous month or # of days since last purchase. I have yet to find a solution that will work using FY (FYI FY is from my Date calender that I have added). I am open to any and all soultions. Thinking an IF formula could work. Thanks
I cant share the data set but I have gave some examples below with the expected results (Status):
Fiscal Year | Date | Customer | Status |
20-21 | 12/21/2021 | A | Reactivated |
17-18 | 12/21/2018 | A | Reactivated |
15-16 | 12/21/2016 | A | New |
20-21 | 12/21/2021 | B | Renewed |
19-20 | 12/21/2020 | B | Reactivated |
15-16 | 12/21/2016 | B | New |
Solved! Go to Solution.
You can use the same computations. Instead of Countrows() you use the Venn results as a filter on the amounts.
New customer Sales =
var tfy = selectedvalue('Calendar'[FY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]<tfy)
return CALCULATE(sum(Sheet1[Amount]),except(tc,pc))
Renewed Customer Sales =
var Pfy = selectedvalue('Calendar'[PFY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]=Pfy)
return CALCULATE(sum(Sheet1[Amount]),intersect(tc,pc))
Reactivated Customer Sales =
var Pfy = selectedvalue('Calendar'[PFY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]=Pfy)
var puc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]<Pfy)
return CALCULATE(sum(Sheet1[Amount]),intersect(except(tc,pc),puc))
Not sure if all numbers make sense though - feel free to validate
That sample data is a good start but it is not sufficient. Please provide sanitized sample data that fully covers your issue. Include your fiscal year rules as well.
Your calendar table should ideally be independent(ish) of the fact table. For Time Intelligence calculations you want it to contain full (fiscal) years. My recommendation would be that you maintain your calendar table outside of Power BI. Could be as simple as an Excel file in a Sharepoint. That way you can also accommodate holidays in your "Working Day" column. Let's hope that your customers are all in countries with the same workweek structure and the same holidays...
a
Thank you for providing the sample data.
Your logic can be implemented with combinations of EXCEPT and INTERSECT in your measures:
New customer =
var tfy = selectedvalue('Calendar'[FY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]<tfy)
return countrows(except(tc,pc))
Renewed Customer =
var Pfy = selectedvalue('Calendar'[PFY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]=Pfy)
return countrows(intersect(tc,pc))
Reactivated Customer =
var Pfy = selectedvalue('Calendar'[PFY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]=Pfy)
var puc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]<Pfy)
return countrows(intersect(except(tc,pc),puc))
See attached. Also note how I created the FY and PFY (previous FY) columns:
Calendar = CALENDARAUTO(3)
FY = Format(edate('Calendar'[Date],-3),"YY-") & Format(edate('Calendar'[Date],+9),"YY")
PFY = Format(edate('Calendar'[Date],-15),"YY-") & Format(edate('Calendar'[Date],-3),"YY")
See attached.
Thank you very much! Was hoping to have this as a coulmn with the text feilds so I could also show #of purchases for each status as well. Would your soultion also compute the number of purchases by status as well?
I don't understand what you are asking for. Can you show the expected outcome?
These calculations could theoretically be done as calculated columns but then you could not impact the results through any filters. You may not want that limitation?
I am hoping to also have # of purchases by customer status. Same thing but instead of number of customers, it would return the number of purchases by customer status.
You can use the same computations. Instead of Countrows() you use the Venn results as a filter on the amounts.
New customer Sales =
var tfy = selectedvalue('Calendar'[FY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]<tfy)
return CALCULATE(sum(Sheet1[Amount]),except(tc,pc))
Renewed Customer Sales =
var Pfy = selectedvalue('Calendar'[PFY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]=Pfy)
return CALCULATE(sum(Sheet1[Amount]),intersect(tc,pc))
Reactivated Customer Sales =
var Pfy = selectedvalue('Calendar'[PFY])
var tc = values(Sheet1[Customer])
var pc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]=Pfy)
var puc = CALCULATEtable(values(Sheet1[Customer]),'Calendar'[FY]<Pfy)
return CALCULATE(sum(Sheet1[Amount]),intersect(except(tc,pc),puc))
Not sure if all numbers make sense though - feel free to validate
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
65 | |
45 | |
39 | |
31 |
User | Count |
---|---|
164 | |
111 | |
61 | |
53 | |
38 |