Forum Discussion
mean of max difference between dates by client
Hi,
I m looking for a measure which can give me the average age of clients invoices history. For that, I ve a table (named FacturationSommaire) with for each invoice:
IdClient - Issue Date - amount
I would like to have the average duration for all clients and for each client
I tried to do like that but i doesnt work:
GEOMEANX(FacturationSommaire;datediff(minx(FacturationSommaire;[Issue Date]);maxx(FacturationSommaire;[Issue Date]);day))
Tank you for help
I suggest you create a calculated table to summarize the duration calculation into a column group on client level.
Table = SUMMARIZE ( FacturationSommaire, FacturationSommaire[IdClient], "Duration", CALCULATE ( 1 * ( MAX ( FacturationSommaire[Date] ) - MIN ( FacturationSommaire[Date] ) ), ALLEXCEPT ( FacturationSommaire, FacturationSommaire[Client] ) ) )Then use GEOMEANX() function on that "Duration" column.
Regards,
1 Reply
- v-sihou-msft
Microsoft Employee
I suggest you create a calculated table to summarize the duration calculation into a column group on client level.
Table = SUMMARIZE ( FacturationSommaire, FacturationSommaire[IdClient], "Duration", CALCULATE ( 1 * ( MAX ( FacturationSommaire[Date] ) - MIN ( FacturationSommaire[Date] ) ), ALLEXCEPT ( FacturationSommaire, FacturationSommaire[Client] ) ) )Then use GEOMEANX() function on that "Duration" column.
Regards,