Forum Discussion
Total percentages
I have this data:
| Country | Fórmula | GTR 23 |
| Costa Rica | Adorlan | 147.305 |
| Costa Rica | Zaldiar | 696.783 |
| El Salvador | Adorlan | 110.572 |
| El Salvador | Zaldiar | 552.542 |
| Guatemala | Adorlan | 292.941 |
| Guatemala | Zaldiar | 408.122 |
And I got this results:
My problem is with the percentages. The thing is that I need that the total in every Country be the result of the Total divided by the total of the Country. What I mean nomerically is, for example; Costa Rica = 844.088/2.208.265 = 38.22%, but keeps the percentages of the products (Adorlan in Costa Rica it is 17.45 that is the result of divide 147.305/844.088.
Is it possible?
Im working with:
Hi, NelsonDíaz1
try below just adjust your table and column name% =var a = CALCULATE(SUM(country[gtr 23]),REMOVEFILTERS(country[Country]))var b = CALCULATE(SUM(country[gtr 23]),REMOVEFILTERS(country[Fórmula]))var c =SWITCH(TRUE(),ISINSCOPE(country[Fórmula]),DIVIDE(SUM(country[gtr 23]),b),ISINSCOPE(country[Country]),DIVIDE(SUM(country[gtr 23]),a))returncIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos
2 Replies
- Dangar332
Resident Rockstar
Hi, NelsonDíaz1
try below just adjust your table and column name% =var a = CALCULATE(SUM(country[gtr 23]),REMOVEFILTERS(country[Country]))var b = CALCULATE(SUM(country[gtr 23]),REMOVEFILTERS(country[Fórmula]))var c =SWITCH(TRUE(),ISINSCOPE(country[Fórmula]),DIVIDE(SUM(country[gtr 23]),b),ISINSCOPE(country[Country]),DIVIDE(SUM(country[gtr 23]),a))returncIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos
- NelsonDíaz1Frequent Visitor
Thanks man.! It is perfect.!