Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi there,
New to powerbi. I would appreciate your help on why my measure is not summing up correctly.
I calculated a discount allowance based on future sales in table and the discount percentages per customer in a different table:
When reviewing each customer individualy my discounts calculate correctly. However when I select all the total does it's own thing.
I've attempted sumx & summaraize functions with no luck. the table below illustrates the issue. my total for Jan for all customers should be 17 972 999.86 with an average DC % of 4.2%
Solved! Go to Solution.
Hi @Anonymous ,
It looks like the problem with your calculated measure is that it is using the SELECTEDVALUE function to determine the value of the BW column. This function will return the selected value of the BW column for the current filter context, which means that the measure will only be calculated for the selected value of BW and will not be aggregated across all values.
To fix this problem, you can modify your calculated measure to use the SUMX function instead of the SELECTEDVALUE function. The SUMX function allows you to iterate over a table and perform calculations on each row, and then sum the results.
Here's an example of how you can modify your calculated measure to use the SUMX function:
DC Allowance (CP) =
SUMX ( SKU, IF ( SKU[BW] = "000000000004179200", 0, DC * [ISV (CP)] ) )
This measure will iterate over the SKU table and calculate the discount allowance for each row using the IF function. If the BW column is equal to "000000000004179200", the value will be set to 0. Otherwise, the value will be calculated using the DC and ISV (CP) columns. The results will then be summed using the SUMX function.
If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
It looks like the problem with your calculated measure is that it is using the SELECTEDVALUE function to determine the value of the BW column. This function will return the selected value of the BW column for the current filter context, which means that the measure will only be calculated for the selected value of BW and will not be aggregated across all values.
To fix this problem, you can modify your calculated measure to use the SUMX function instead of the SELECTEDVALUE function. The SUMX function allows you to iterate over a table and perform calculations on each row, and then sum the results.
Here's an example of how you can modify your calculated measure to use the SUMX function:
DC Allowance (CP) =
SUMX ( SKU, IF ( SKU[BW] = "000000000004179200", 0, DC * [ISV (CP)] ) )
This measure will iterate over the SKU table and calculate the discount allowance for each row using the IF function. If the BW column is equal to "000000000004179200", the value will be set to 0. Otherwise, the value will be calculated using the DC and ISV (CP) columns. The results will then be summed using the SUMX function.
If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
67 | |
65 | |
57 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |