Forum Discussion

GBilger's avatar
GBilger
Frequent Visitor
4 years ago
Solved

Dynamic Forecast Comparison

Hi,   The table below shows a summary of the data I'm working with.  Each row represents a different production forecast for a given year.  If I select a Year in the slicer, I want to display a wat...
  • BeaBF's avatar
    4 years ago

    GBilger what you can do is calculate a dynamic measure that returns the delta between the forecasts, so as to pass them directly into the chart and thus remove the subtotals, like this:

     

    The graph above is the original one, in the one below I passed the DELTA measure as a value, calculated as follows:

    DELTA = CALCULATE(SUM(Tabella[Volume]), ALLSELECTED(Tabella[Production Date ])) - CALCULATE(SUM(Tabella[PREV_VOLUME]), ALLSELECTED(Tabella[PREV_DATE]))
    where PREV_VOLUME and PREV_DATE are two calculated columns:
    PREV_DATE = LOOKUPVALUE(Tabella[Production Date ],Tabella[Indice],Tabella[Indice]-1)
    PREV_DATE = LOOKUPVALUE(Tabella[Production Date ],Tabella[Indice],Tabella[Indice]-1)
    instead Index is a column that you can insert from the power query in the sorting you prefer to give to the data to calculate the differential.
    I hope I was clear, let me know,
    B.