Forum Discussion
Visual Calculation - Weekly and Overall %Plan %Actual
- 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
- 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,
- 1 year ago
Weekly % Achieved
Weekly % Achieved = DIVIDE([Actual], [Plan], 0)
Overall % AchievedOverall % Achieved = DIVIDE([Actual], [Plan], 0)
Add both to your table/matrix visual.
Weekly % = week-wise performance, Overall % = cumulative performance.
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,
- AllanBerces1 year ago
Post Prodigy
Hi Shahid12523 DataNinja777 FBergamaschi thank you very much for the reply, working perfectly.