Forum Discussion

grubpot's avatar
grubpot
Frequent Visitor
6 years ago
Solved

Help with calclulation - so easy in Excel - no idea how to do this in Power BI

Hi, Hopefully someone has done something similar to this. I have searched but cannot find the solution. I need to create a measure that returns the percentage of products where we have hit a decent...
  • rajulshah's avatar
    rajulshah
    6 years ago

    Hello grubpot,

    Please create the following measures which will help you achieve your requirement:

    Accuracy Measure = 
    VAR Difference = SUM('Forecast Sales'[Ordered]) - SUM('Forecast Sales'[Forecast])
    RETURN DIVIDE(Difference,SUM('Forecast Sales'[Forecast]))
    Total in Tolerance = 
    VAR SummarizedTable = SUMMARIZE('Forecast Sales','Forecast Sales'[SKU],"Accuracy Value",[Accuracy Measure])
    RETURN COUNTX(FILTER(SummarizedTable,[Accuracy Value]<0),'Forecast Sales'[SKU])
    Tolerance Rate = 
    VAR TotalSKU = DISTINCTCOUNT('Forecast Sales'[SKU])
    VAR ToleranceSKU = [Total in Tolerance]
    RETURN DIVIDE(ToleranceSKU,TotalSKU)

     

    Hope this helps.