Forum Discussion
Anonymous
3 years agoNot applicable
New Customer Pattern Question - Modify to Consider Start Date Range Instead of Single Date
Hello everyone, I've beeing using an example from dax pattern to attempt to display a matrix where new customer revenue begins on the start date for each customer and ends after one year. The exam...
Greg_Deckler
3 years agoCommunity Champion
Anonymous
Take a look at these two Quick Measures as I think you want something like them.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365
Anonymous
3 years agoNot applicable
Greg_Deckler Thanks so much I'll give these a shot in the morning!
- Anonymous3 years agoNot applicable
Not certain what I've done wrong, but it just continues past one year. I'm sure it's something I've missed here's the full example.
VAR tmpCalendar = ADDCOLUMNS('DIM Date',"DDate",DATEVALUE('DIM Date'[Date])) VAR tmpBilling = ADDCOLUMNS('Sales',"StartDate",DATEVALUE(MIN('Sales'[Date])), "EndDate",DATEVALUE(MIN('Sales'[Date])+365)) VAR tmpTable = SELECTCOLUMNS( FILTER( GENERATE( tmpBilling, SUMMARIZE(tmpCalendar,[DDate]) ), [DDate] >= [StartDate] && [DDate] <= [EndDate] ), "Customer",'Sales'[Customer], "Date", [Date], "Amount", 'Sales'[Revenue] ) RETURN SUMX(tmpTable,[Amount])