The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello .
I try sum function to find sum of SKU in the following table. In excel pivot table sum function shows BD6-24E = 29 while in power bi sum function show BD6-24E = 30. Can somebody please help me ? I tested calculate and by changing quantity format to decimal. it shows the same result.
regards
Mohsin
Solved! Go to Solution.
Dear @mohsin-raza ,
The discrepancy likely arises from how Excel and Power BI handle data aggregation, especially if there are negative or repeated values. Let's break it down:
Excel Pivot Table Calculation (Showing 29):
If Excel is ignoring the negative value (or potentially applying a filter or a distinct count), it might sum as:
24 + 24 + 6 + 12 = 66 minus the -1 gives 65.
However, if Excel applies a different aggregation rule, it could ignore the repeated 24 or exclude the negative value.
Troubleshooting Steps:
Check the Pivot Table Settings in Excel:
Total_BD6_24E =
CALCULATE(
SUM('Table'[Quantity]),
'Table'[SKU] = "BD6-24E",
'Table'[Quantity] >= 0
)
Ensure Data Types Match:
Recheck Data in Power BI:
Please mark this post as solution if it helps you. Appreciate Kudos.
Hello @mohsin-raza
It appears you may have overlooked some quantities for BD6-24E in your calculations. Based on the screenshot data, the total quantity for BD6-24E is 65, not 30 or 29. This includes all instances of BD6-24E, even the negative quantity. Here is the screenshot of your data where I have highlighted the rows that you have missed in light blue color:
Power BI also confirms this total of 65,i.e., it is also taking care of the negative values in the dataset. Here is the screenshot:
Could you clarify what might be causing the discrepancy?
Could you please provide sample data that fully represents your issue or question in a usable format, rather than a screenshot? Ensure the dataset is anonymized and does not contain any sensitive or unrelated information.
Additionally, it would be very helpful if you could share the expected outcome based on the provided data - this can be in any format, including a screenshot. Having a clear reference for comparison will significantly improve the chances of getting the correct solution in the first response.
For best practices, you may find the following links useful:
Thanks,
Udit
Please provide example data as text (not a screen print).
With screen print proof of the Exvel formula, DAX formula
Please note you have only highlighted some of BD6-24E rows
Check carefully for lower case and trailing spaces because Power BI is not case sensitive and ignores trailing spaces, where as EXCEL does not.
So in this example Excel would give a sum BD6-24E = 11 +5 = 16
Whereas Power BI = 11 + 5 - 4 - 3 - 2 - 1 = 6 !
BD6-24E = 11
BD6-24E = 5
Bd6-24e = - 4
BD6-24E space = -3
BD6-24E space space - 2
BD6-24E space space - 1
Please click thumbs up foerthese suggestions. 👍
also click accept solution if they work.
You can acceot more than one solution. 😀
@speedramps Thanks alot for detail analysis and pointing out the data that I missed.
As I mentioned in other replies . I got data format issue which was not measure . I was analysis my results both in power bi and pivot table . I found different result.
After I asked for help. I refresh database . The row with a nagetive value was remove and I got the same result.
@speedramps @FarhanJeelani @powerbidev123 Thanks alot again All of you people for contribution. and every suggestion from you people is the solution to related problems.
Dear @mohsin-raza ,
The discrepancy likely arises from how Excel and Power BI handle data aggregation, especially if there are negative or repeated values. Let's break it down:
Excel Pivot Table Calculation (Showing 29):
If Excel is ignoring the negative value (or potentially applying a filter or a distinct count), it might sum as:
24 + 24 + 6 + 12 = 66 minus the -1 gives 65.
However, if Excel applies a different aggregation rule, it could ignore the repeated 24 or exclude the negative value.
Troubleshooting Steps:
Check the Pivot Table Settings in Excel:
Total_BD6_24E =
CALCULATE(
SUM('Table'[Quantity]),
'Table'[SKU] = "BD6-24E",
'Table'[Quantity] >= 0
)
Ensure Data Types Match:
Recheck Data in Power BI:
Please mark this post as solution if it helps you. Appreciate Kudos.
@FarhanJeelani Thanks alot for your detail analysis and solution. Yes there was issue with data format back in database. I refresh the database . it is solved
Thanks alot for your feed back. I refresh the database . Now I get the same answer
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |