Forum Discussion
measure not calculating % correctly
I have a measure with the following formula:
For an individual site here the numbers:
| State | Count | % from Excel | % from PBI Measure |
| blank | 248 | 2.11% | 2.00% |
| early | 9122 | 77.51% | 71.80% |
| late | 1814 | 15.41% | 14.30% |
| On Time | 585 | 4.97% | 4.60% |
| Total | 11769 | 100.00% | 92.70% |
Why are the percentages using the measure not correct?
4 Replies
- rohit1991
Super User
The issue is with the ALL function. Use this corrected measure:
% of Shipment by PickupPerformance by Site = DIVIDE( SUM(TMSShipmentDetail[ShipmentCount]), CALCULATE( SUM(TMSShipmentDetail[ShipmentCount]), ALL(TMSShipmentDetail) ) )This ensures the denominator uses the total shipment count without filters, matching Excel percentages.
- rajendraongole1
Super User
Hi TomSinAA - check the denominator includes all rows, regardless of filters on any column
use the below measure:
% of Shipment by PickupPerformance by Site =
DIVIDE(
SUM(TMSShipmentDetail[ShipmentCount]),
CALCULATE(
SUM(TMSShipmentDetail[ShipmentCount]),
ALL(TMSShipmentDetail)
)
)the above logic helps
- TomSinAA
Helper IV
That did not seem to work.
- AnonymousNot applicable
Hi TomSinAA
Could you please explain the calculation logic you need and provide relevant example data or table structures(exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.