Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  need some help with a Dax average calculation

    Posted Jul 13, 2022 10:51 AM

    I have column of data.  it is a fixed days calculation.  so it takes the resolved date, subtracts the open date and gives an integer day value back

    1
    2
    3
    4
    5
    6
    7
    etc
    I need an average of the days 4 - 30 only
    not sure the formula

    thinking something like this

    Avg4_30Days = Averagex(FILTERs(incidents_av[sladays],between 4 and 30))
    any help is appreciated.  thank you.


    ------------------------------
    Randy Etheridge
    Veritiv Corporation
    P&F USA Inc
    Torrance CA
    770-315-9670
    ------------------------------


  • 2.  RE: need some help with a Dax average calculation

    Posted Jul 13, 2022 01:50 PM

    Hi Randy,

    Avg4_30Days =

    CALCULATE(
           AVERAGE([Column_To_Calculate]),
           [sladays]>4 && [sladays]<30
           )

    Regards,



    ------------------------------
    Adam Artur Boltryk
    Business Analyst
    ------------------------------



  • 3.  RE: need some help with a Dax average calculation

    Posted Jul 13, 2022 02:43 PM

    ok so I did this

    Avg4_30days = CALCULATE(Average(incidents_av[sladays]),[sladays]>=4&&[sladays]<=30)

    so my column containing the days is SLAdays.  the error message says the [Sladays] in the 4 to 30 statement is not valid.
    I am playing with it, but so far nothing, but thanks for the additional information.


    ------------------------------
    Randy Etheridge
    Veritiv Corporation
    P&F USA Inc
    Torrance CA
    770-315-9670
    ------------------------------



  • 4.  RE: need some help with a Dax average calculation

    Posted Jul 13, 2022 02:45 PM

    just one more comment the view that PowerBI is using is incidents_av

    one of the columns of data is SLAdays (calculated in the view)



    ------------------------------
    Randy Etheridge
    Veritiv Corporation
    P&F USA Inc
    Torrance CA
    770-315-9670
    ------------------------------



  • 5.  RE: need some help with a Dax average calculation

    Posted Jul 13, 2022 02:52 PM
    never mind typo, works perfect thanks

    ------------------------------
    Randy Etheridge
    Veritiv Corporation
    P&F USA Inc
    Torrance CA
    770-315-9670
    ------------------------------