Forum Discussion
derekli1700
Helper III
2 years agoNeed help with getting average monthly activity duration and monthly volume of customer
Date of Action Customer Volume Transaction Assets 13/01/2020 Customer A 44,499.2 1,148 60 5/03/2020 Customer B 2,18...
- 2 years ago
Hi,
PBi file attached.
ryan_mayu
Super User
2 years agopls try this
Measure =
var tbl = ADDCOLUMNS( SUMMARIZE('Table','Table'[Customer],"mindate",min('Table'[Date of Action]),"maxdate",max('Table'[Date of Action])),"month", DATEDIFF([mindate],[maxdate],MONTH))
return sumx(tbl,[month])
Measure 2 = sumx(FILTER('Table','Table'[Customer]="Customer A"),'Table'[Transaction])/ sumx(FILTER('Table','Table'[Customer]="Customer A"),'Table'[Assets])
pls see the attachment below
derekli1700
Helper III
2 years agoHey thats really helpful thanks -
For measure 1, my main data has a date heirachy which shows quarter, months, days etc as a dropdown. Does the measure still work for this?
regarding measure 2, is there way for the measure to calculate the overall average customer transaction per assets (rather than one customer)? Thanks
- ryan_mayu2 years ago
Super User
for measure 1, not very clear about your request, you can have a try to see if it works.
there is something wrong in measure 1, pls use averagex instead of sumx
for measure 2, is the similar calculation logic you used for measure 1?
var tbl = ADDCOLUMNS( SUMMARIZE('Table','Table'[Customer],"mindate",min('Table'[Date of Action]),"maxdate",max('Table'[Date of Action])),"col",sum('Table'[Transaction])/sum('Table'[Assets]))return average(tbl,[col])