Forum Discussion

Jkaelin's avatar
Jkaelin
Resolver I
9 years ago
Solved

First Post! Calculate Average Sales Within Percentile

  Good afternoon,   I'm trying to calculate a dynamic DAX measure to provide the average Net Profit for the Top 20% of Sales by Date.     A formula that does NOT work (returns a blank value):  =...
  • Vvelarde's avatar
    9 years ago

    Jkaelin

     

    Hi, try with this:

     

    Measure =
    VAR P80=PERCENTILE.EXC(Table1[Sales],0.8)
    RETURN
    CALCULATE(AVERAGE(Table1[netProfit]),FILTER(Table1,Table1[Sales]>=P80))

  • Vvelarde's avatar
    Vvelarde
    9 years ago

    Jkaelin

     

    hi, is just one measure. put together in the creation of the measure. don't split in 2.

     

    Let me know if works.