Forum Discussion

AllanBerces's avatar
AllanBerces
Icon for Post Prodigy rankPost Prodigy
1 year ago
Solved

Visual Calculation - Weekly and Overall %Plan %Actual

Hi good day can anyone help me on my visual calcuation for weekly and overall % plan and actual. Thank you  
  • FBergamaschi's avatar
    1 year ago

    HI AllanBerces,

     

    weekly actual vs plan = DIVIDE ( [Actual] - [Plan], [Plan] )

     

    overall actual vs plan = DIVIDE ( [**bleep** Actual] - [**bleep** Plan], [**bleep** Plan] )

     

    If this helped, please consider giving kudos and mark as a solution

    @me in replies or I'll lose your thread

    Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

    Consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

  • DataNinja777's avatar
    1 year ago

    Hi AllanBerces ,

     

    To calculate your weekly percentage of actual versus plan, you can add a new calculation directly on your visual. First, select your table, and then click the "New calculation" button. In the formula bar, you would enter the following DAX expression. This formula works by dividing the "Actual" value by the "Plan" value for each week. After you create this new measure, be sure to format it as a percentage in the formatting pane to display it correctly.

     

    Weekly % vs Plan = DIVIDE([Actual], [Plan])

    For the overall or cumulative percentage of actual versus plan, you will follow a similar process. Create another new calculation on the same visual. This time, you'll use the cumulative columns from your data. The DAX formula for this calculation is shown below. This will give you a running total of your performance across all the weeks. Just like the weekly calculation, you should format this new measure as a percentage.

    Overall % vs Plan = DIVIDE([**bleep** Actual], [**bleep** Plan])

     

    Using the DIVIDE() function is a best practice in DAX because it gracefully handles any potential division by zero errors, which might occur if you have a week with a "Plan" value of zero. This prevents your visual from breaking and showing an error.

     

    Best regards,

  • Shahid12523's avatar
    1 year ago

    Weekly % Achieved

     

    Weekly % Achieved = DIVIDE([Actual], [Plan], 0)


    Overall % Achieved

     

    Overall % Achieved = DIVIDE([Actual], [Plan], 0)


    Add both to your table/matrix visual.


    Weekly % = week-wise performance, Overall % = cumulative performance.