The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
hi everyone,
Hope anyone can help, I get trouble when facing this issue:
I have 2 tables:
Dim_Customer ([CusID],[OpenDate])
fSales ([PurcharseDate],[CusID])
Connect by [CusID]
I want to calulate average number of days between Open Date and The first Purchase date of a group of Customer,
Can anyone help me how can I calculate it.
Thank you so much
Solved! Go to Solution.
@Anonymous , Try a new
avergageX(values(Dim_Customer[CusID]), datediff(min(Dim_Customer[OpenDate]), min(fSales[PurcharseDate]),day))
oh so sorry, I didn't descript my issue clearly,
@amitchandak I followed your solution but it has another problem:
I try this DAX:
--
there are some customers haven't had purchase yet (so their min(fSales[PurcharseDate]) is null) and some cases the OpenDate is after first PurcharseDate (because of special condition of my company), I want to calculate customers who has OpenDate <= the first PurchaseDate only.
How could it be?
Thank you
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |