Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
phaum1967
Resolver I
Resolver I

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

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@phaum1967

 

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,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@phaum1967

 

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,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.