Forum Discussion

viralpatel21's avatar
viralpatel21
Helper II
5 years ago
Solved

Calculate Average Balance

Hello World   I am trying to calculate the average balance using 2 measure. But i am not sure how?   my 2 measure are Total Balance = CALCULATE ( SUM ( au_bitgowallets[au_balance] ), USEREL...
  • v-luwang-msft's avatar
    5 years ago

    Hi viralpatel21 ,

    The average balance is equal to the total balance divided by the number of wallets.

    Average Balance=
    var Total_Balance =
    CALCULATE (
        SUM ( au_bitgowallets[au_balance] ),
        USERELATIONSHIP ( au_bitgowallets[CreatedDate], FeeDate[Date] )
    )
    var Number_balance =
    CALCULATE (
        DISTINCTCOUNT ( au_bitgowallets[au_bitgowalletid] ),
        FILTER ( au_bitgowallets, au_bitgowallets[au_balance] > 0 ),
        USERELATIONSHIP ( FeeDate[Date], au_bitgowallets[CreatedDate] )
    )
    
    RETURN  Total_Balance/Number_balance

    You can substitute the measure into pbix to see if the final result is accurate.

     

    Wish it is helpful for you!

     

    Best Regards

    Lucien