Forum Discussion
Aletom7
10 years agoRegular Visitor
Problem with Ratios
Hello, I'm pretty new here in the community, hope this is not a repeated post. I have a problem showing ratios in powerbi. I want the ratios be sorted by category and year in the same chart: ...
Aletom7
10 years agoRegular Visitor
If it is possible, I want to have all the ratios calculated for category in a single column so that I can see wich is the incidence of every cost category on the total of the revenues.
For example, if I use numerical data I obtain this result:
I guessed to obtain what I want simply using the function of rapid calculation choosing the percentage of total, but what I obtain is this chart:
So, this last chart is exactly what I want to see at the end, but with the right ratios.
Thank you,
Alessandro
v-haibl-msft
10 years agoMicrosoft Employee
Thanks for your description, I seem to get the point. I think we need to do some transformation for the original dataset with following steps.
- In Query Editor, remove two columns of “Type” and “COSTS”.
- Unpivot all the columns except the first column of “YEAR”.
- Click ‘Group By’ and set as below.
- Create a measure with following formula.
Ratio = SUM ( 'ESTRAZIONE DATI'[NewValue] ) / CALCULATE ( SUM ( 'ESTRAZIONE DATI'[NewValue] ), 'ESTRAZIONE DATI'[Attribute] = "REVENUES" )
Best Regards,
Herbert