Forum Discussion
Krcmajster
4 years agoHelper IV
Totals completely incorrect
I am having a strange behaviour in Power BI. Below screenshot will summarize it. The total is not even close to what it should be based on the values above.
Below is the summary of the calculation
there are 2 tables Sales and Percentage, with one (sales) o many relationship, one directional.
I have below calculation
Percentage per Sales =
DIVIDE(DIVIDE(SUM ( 'Percentage'[Percent] ) , COUNTROWS ( Sales )),100)
and
Amount= SUMX('Sales', 'Sales'[Amount]) * [Percentage per Sales]
Amount= SUMX('Sales', 'Sales'[Amount]) * [Percentage per Sales]
Amount of each sales can be split by percentage, that is why I need the calculation.
So Sales ID 100 can have amount of 10,000, and there are percentages of 20 and 40. Which would mean that my calculation needs to be 10,000*0.2=2,000 and 10,000*0.4=4,000, so the total for Sales ID 100 is 6,000. Which I achieved with Percentage per Sales measure, but the totals are incorrect in table or cards.
So Sales ID 100 can have amount of 10,000, and there are percentages of 20 and 40. Which would mean that my calculation needs to be 10,000*0.2=2,000 and 10,000*0.4=4,000, so the total for Sales ID 100 is 6,000. Which I achieved with Percentage per Sales measure, but the totals are incorrect in table or cards.
Krcmajster , Try a measure like
Amount= SUMX(values('Sales'[ID]), calculate(sum('Sales'[Amount]) * [Percentage per Sales]))
1 Reply
- amitchandakSuper User
Krcmajster , Try a measure like
Amount= SUMX(values('Sales'[ID]), calculate(sum('Sales'[Amount]) * [Percentage per Sales]))