Forum Discussion
Convert the value to%
I have a measure in which I must bring the value of it inwardly and also in percentage:
Productivity = (sum (IndicatorValue [Value]) / COUNT (Equipment [Description]))
When I bring the information in integer, the information comes in correctly, but when I bring it in the percentage format it does not treat the information, applying only the% to the end of the value, thus leaving the incorrect value.
In this case the value to be presented in% would be 85.68%.
What should I do to get the correct value in% displayed as I expect?
- Anonymous9 years ago
Hi Anonymous,
Agree with @vanessafvg.Your issue is caused by that the Productivity measure returns a value which is greater than 1, when you convert it to percentage in Power BI, the Productivity value will be multiplied by 100 and be displayed with % added. Only when the Productivity measure returns a value which is less than 1, you will get a percentage value within 100%.
If you want to make the current measure return 0.8568, you would need to write the measure using : ((sum (IndicatorValue [Value]) / COUNT (Equipment [Description])))*0.0000001. This way, when you convert it to %, you will get 85.68%. However, I don’t think the above formula makes any sense, as you manually multiply the measure by 0.0000001.
Regards,
Lydia Zhang
10 Replies
- vanessafvgCommunity Champion
It would need to be a decimal, an integer is greater than or = 1, if you wanted to convert it to a % using the % formatter, your base data would need to be 0.8568 for the % formatter to adjust it correctly.
- AnonymousNot applicable
Using the measure I posted, is it possible to give an example of how it should be?
- vanessafvgCommunity Champion
Anonymous
when you divide a total into a count that is usually to get an average number. ie the average value, What is the measure called and what is its purpose?
so when you say value/ count what do those number refer to and what are you trying to do, hope that makes sense
- jayecklesAdvocate III
First, create a new measure that sums IndicatorValue[Value]:
Indicator Values = calculate(sum(IndicatorValue[Value]))
Next, create a new measure that counts Equipment[Description] regardless of context (that is, filters on other fields):
Machine Count = calculate( DISTINCTCOUNT( Equipment[Description]), All( Equipment ) )
If you have fields for which you want to maintain the context (that is, if you have a slicer for Factory and you want the denominator of your productivity quotient to include only machines in that factory, you can use AllExcept, e.g.:
Machine Count = calculate( DISTINCTCOUNT(Equipment[Description]), AllExcept(Equipment,Equipment[Factory]))
Finally, a new measure that calculates the quotient:
Productivity = [Indicator Values]/[Machine Count]
Use the modeling tab to set the format of Productivity to a percentage.
- AnonymousNot applicable
I made the suggested change prem the value that is reported when converted to percent% is 885205,021% ie the format is still incorrect, it should display 88.52%
- AnonymousNot applicable
Hi Anonymous,
Agree with @vanessafvg.Your issue is caused by that the Productivity measure returns a value which is greater than 1, when you convert it to percentage in Power BI, the Productivity value will be multiplied by 100 and be displayed with % added. Only when the Productivity measure returns a value which is less than 1, you will get a percentage value within 100%.
If you want to make the current measure return 0.8568, you would need to write the measure using : ((sum (IndicatorValue [Value]) / COUNT (Equipment [Description])))*0.0000001. This way, when you convert it to %, you will get 85.68%. However, I don’t think the above formula makes any sense, as you manually multiply the measure by 0.0000001.
Regards,
Lydia Zhang- vanessafvgCommunity Champion
personally i think there is something incorrect in the data that is making the % that high, otherwise you have some super effective machinery