Forum Discussion
calebfoster
2 years agoNew Member
90 Days From First Purchase Date?
Hello, I am having a difficult time figuring out this Power BI exercise that uses AdventureWorks data. Here is my PBIX file: LINK . I must replicate the following screenshot in Power BI, specifically...
- 2 years ago
ooutput
returned users within 90 days= var ds = distinct( SELECTCOLUMNS( FILTER(Sales,Sales[CustomerKey] = RELATED(Customers[AltCustomerKey]) && Sales[OrderDate] = RELATED(Customers[DateFirstPurchase]) ), Sales[CustomerKey] )) var ds_90_days = DISTINCT( SELECTCOLUMNS( FILTER( all(sales), Sales[OrderDate]> MIN('Date'[Date]) && Sales[OrderDate] <=MIN('Date'[Date]) + 90 ),Sales[CustomerKey] )) var res = INTERSECT(ds,ds_90_days) return COUNTROWS(res)let me know if this works for you .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
Daniel29195
2 years agoCommunity Champion
ooutput
returned users within 90 days=
var ds =
distinct(
SELECTCOLUMNS(
FILTER(Sales,Sales[CustomerKey] = RELATED(Customers[AltCustomerKey])
&& Sales[OrderDate] = RELATED(Customers[DateFirstPurchase])
),
Sales[CustomerKey]
))
var ds_90_days =
DISTINCT(
SELECTCOLUMNS(
FILTER(
all(sales),
Sales[OrderDate]> MIN('Date'[Date]) && Sales[OrderDate] <=MIN('Date'[Date]) + 90
),Sales[CustomerKey]
))
var res =
INTERSECT(ds,ds_90_days)
return COUNTROWS(res)
let me know if this works for you .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
beachwaves18
1 year agoNew Member
I know this has been awhile, but I have a similar request. Any idea what could be making this formula only return blank values? I've tried to change several parts but can't figure it out