Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Average selected date by Count values

HI Team I have 2 filter my report below I have table below format Date Country_Name Count 20-May-20 INDIA 20 20-May-20 AMERICA 10 20-May-20 South africa 30 21-May-20 ...
  • V-lianl-msft's avatar
    V-lianl-msft
    6 years ago

    Hi Anonymous ,

     

    You can try measure like this:

    average_count =
    VAR RunningTotal =
        CALCULATE (
            SUM ( 'Table'[Count] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                SUMX (
                    FILTER (
                        ( 'Table' ),
                        EARLIER ( 'Table'[Country_Name] ) = 'Table'[Country_Name]
                    ),
                    'Table'[Count]
                )
            )
        )
    VAR distinct_day =
        CALCULATE ( DISTINCTCOUNT ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
    RETURN
        DIVIDE ( RunningTotal, distinct_day )

     

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