Forum Discussion
Going from usage to usage frequency over time
- 9 years ago
Anonymous, thank you so much for taking the time. I eneded up just doing it step by step.
1. I added 5 dimensions in my original table, one for each period with the period date
2. I created 5 group queries, each grouping on a different dimension
3. I merged the 5 queries and got one master table with bucets per period
Hi milpro011,
It sounds like I have misunderstood your requirement, you want to calculate the frequency by user,right?
If this is a case, I have modify above formula to calculate the users(a bit modify).
Calculate column:
frequency =
var currWeekNum=WEEKNUM(MAX([Date]),1)
Var actionCount =
COUNTAX(FILTER(ALL('Calculate Count'),
AND([Date]>=DATEADD('Calculate Count'[Date],-14,DAY)&&[Date]<=EARLIER([Date]),[User]=EARLIER('Calculate Count'[User]))),[User])
return
if(actionCount>=9,"daily",if(actionCount>=5,"weekly",if(actionCount>=1,"occasionally","Inactive")))
Summary of Week =
var temp =DISTINCT(SELECTCOLUMNS('Calculate Count',"WeekNumber",WEEKNUM([Date],1),"User",[User],"frequency",[frequency]))
var result=SELECTCOLUMNS(DISTINCT(SELECTCOLUMNS(temp,"Week",[WeekNumber],"User",[User],"frequency",
if(CONTAINS(FILTER(temp,[User]=EARLIER([User])&&[WeekNumber]=EARLIER([WeekNumber])),[frequency],"daily"),"daily",
if(CONTAINS(FILTER(temp,[User]=EARLIER([User])&&[WeekNumber]=EARLIER([WeekNumber])),[frequency],"weekly"),"weekly",
if(CONTAINS(FILTER(temp,[User]=EARLIER([User])&&[WeekNumber]=EARLIER([WeekNumber])),[frequency],"occasionally"),"occasionally","Inactive"
))))),"WeekNumber",[Week],"Current frequency",[User]&": "&[frequency])
return
SUMMARIZE(result,[WeekNumber],"Detail",CONCATENATEX(FILTER(result,[WeekNumber]=EARLIER([WeekNumber])),[Current frequency]&", "))
Notice: I add a method to filter the low state.
If above still not in the right direction, please feel free to let me know.
Regards,
Xiaoxin Sheng
Anonymous, thank you so much for taking the time. I eneded up just doing it step by step.
1. I added 5 dimensions in my original table, one for each period with the period date
2. I created 5 group queries, each grouping on a different dimension
3. I merged the 5 queries and got one master table with bucets per period