Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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