Forum Discussion

Andersen123's avatar
Andersen123
New Member
8 years ago

Need to reference an active filter in a measure - complex reporting

Hi,

 

I am quite desperate, as I have been working for weeks to build a really complex report using PowerBI, any help is appreciated. I think I might have reached the limitation of the current software.

 

I have a full table with Material codes, Sales organizations and periods (those define the level of the forecast accuracy calculation), and for the values I have an Actual demand and Forecasted Demand column. In order to measure forecast accuracy, I have set up a Deviation custom column (it needs to be calculated on a product + sales org level), which takes the ABS(Actual-Forecast), which is later used in other calculations. This works fine and provides valid results if only looking for 1 period.

 

However, when looking at multiple, following periods (lets say period 3-5, but any combination is possible), I would have to first add up all the actual demand related to those certain filtered periods, and also add up all the forecasts, and then for each of these material + sales organization combination, take the difference between the two, to get the absolute deviation.

 

Therefore I have created a supporting table, containing material, sales organization and Actual, Forecast which would do this exercise, and it works very well when I just manually define the filter I need, like: Actual = CALCULATE(SUM(Full[Act]);OR(Full[Period]=2;Full[Period]=3)) but I would need to replace the second part with the results of a filter. Currently, I found no ways for this measure to be calculated based on selected filters. This is the only way the forecast accuracy could be calculated in the right way, maybe a workaround is possible, but we haven't found one.

 

Please look at picturs attached: I would like the second table to sum up the given way the values, by only taking the selected periods into account, NOT all and NOT a pre-defined one.

 

Any advise would be much appreciated,

Andersen

1 Reply

  • v-ljerr-msft's avatar
    v-ljerr-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Andersen123,

     

    Could you share a sample pbix file(with just some sample/mock data) which can reproduce the issue? So that we can do some tests on it, in order to better understand your scenario and find a solution. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. :smileyhappy:

     

    Regards