Forum Discussion

MWithrow's avatar
MWithrow
Frequent Visitor
5 years ago
Solved

Dynamic Graph of Averages with Multidimensional Data

I'd first like to apologize for the title.  I'm not sure how to describe my problem in one line.  I'm not sure if I can change the title after posting, but please let me know if you have a suggestion...
  • MWithrow's avatar
    5 years ago

    I had a co-worker help me out with this one.  The solution:

    The following was not giving me what I needed...

    measure_product_a = AVERAGEX(FILTER(Futures,Futures[product]=="a"),[value])

    measure_margin = MAX(0, [measure_product_a] - 2 * [measure_product_b]) 

    ...but creating a new measure got the calculation to act the way I needed it (calculating for each forward month instead of calculating with average values):

    measure_margin_byFutureMonth = 
    AVERAGEX(SUMMARIZE(Futures,'Forward Periods'[Date],"name",[measure_margin]),[measure_margin])

    ***Solution***