Percentage calculated through different levels

0

Hello! I recently started some developments in Power BI and I have the following doubt:

I have a test table composed as follows:

AfterimportingthebasetoPowerBIIcreatedanewcolumninsidethetoolthatcalculatesthepercentageofVALOR1overVALOR_TOTAL,anditlookslikethis:

Theproblemisthis,whenIcreateatableandsearchthedatauptothelastlevel(COD_ITEM)thepercentagevaluecomescorrect(aspicturedabove).However,whenIwanttogroupbyalevelabove(COD_SUBGRUPOforexample),whensummingthevaluesbySUBGROUPIcannotgetthepercentageofthetotalthatVALOR1represents,therefore,whengroupingthe%withPowerBISOMAlinevaluesinsteadofcalculatingthepercentageonthatlevel.

In the image above for example. In the first line I have:

  

VALUE1 = 138
     VALUE_TOTAL = 270

In this case the PORC_VALOR1 field should be with the value = 0.51 (51%) (Percentage of PORC_VALOR1 over VALOR1 ). However, it is 2.47 (247%), so PowerBI is adding the lines below that field, and not calculating the percentage at the level I'm displaying

How to do this?

    
asked by anonymous 18.04.2018 / 14:41

0 answers