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.
I want to add all orders done by the customer exactly 1 year after first order. For example customerID 1000 first order was march 3 2006. I want to add all orders done up to march 3 2007.
Solved! Go to Solution.
Hi @ligalbert
You can refer to the following measure
Measure = var a=CALCULATE(FIRSTNONBLANK('Table'[OrderDate],0),'Table'[CustomerID]=SELECTEDVALUE('Table'[CustomerID]),REMOVEFILTERS('Table'))
return CALCULATE(SUM('Table'[Orders Order]),'Table'[OrderDate]>=a&&'Table'[OrderDate]<=EOMONTH(a,12)-(DAY(EOMONTH(a,0))-DAY(a)))
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ligalbert
You can refer to the following measure
Measure = var a=CALCULATE(FIRSTNONBLANK('Table'[OrderDate],0),'Table'[CustomerID]=SELECTEDVALUE('Table'[CustomerID]),REMOVEFILTERS('Table'))
return CALCULATE(SUM('Table'[Orders Order]),'Table'[OrderDate]>=a&&'Table'[OrderDate]<=EOMONTH(a,12)-(DAY(EOMONTH(a,0))-DAY(a)))
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.