Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Promedio en powerbi

Buenas tardes, necesito ayuda con un problema en powerbi, cuento con la siguiente tabla "cliente, fecha de visita" Cli1, 01/01/2022 Cli1, 02/01/2022 Cli 2, 01/01/2022 Cli 2, 02/01/2022 Cli 2, 0...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Please try:

    average =
    CALCULATE (
        COUNTROWS ( 'Table' ) / DISTINCTCOUNT ( 'Table'[Client] ),
        FILTER (
            'Table',
            YEAR ( [date of visit] ) = YEAR ( MAX ( 'Table'[date of visit] ) )
                && MONTH ( [date of visit] ) = MONTH ( MAX ( 'Table'[date of visit] ) )
        )
    )
    

    Output:

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.