Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Show Expression as Percentage

Hi,

I have a pie chart and I want to format the value in the expression as Percentage of total Values.

Anyway I can do that inside of the expression script?

Thxs,

Alec,

1 Solution

Accepted Solutions
Anonymous
Not applicable

In this case, try:

num(sum(Value)/sum(total Value), '#,##0%')

View solution in original post

8 Replies
nagaiank
Specialist III
Specialist III

Just check the 'Relative' checkbox and percentages will be displayed.

alec1982
Specialist II
Specialist II
Author

I cannot use this option as I have a toggle to chnage the expression by user.

The only way I can do is by setting that on the script expression but I don't know how to do that.

Thxs,

Anonymous
Not applicable

In this case, try:

num(sum(Value)/sum(total Value), '#,##0%')

alec1982
Specialist II
Specialist II
Author

Hi,

Thanks for the replay .

Logic is correct but the field Value and Total Value are the same field.

I tried:

Num(Sum([Sales])/Sum({1}[Sales]), '#,##0%')

But I got 100% on on all values.

Thxs,

Not applicable

Hi,

Michael's expression should work.sum(total sales) forces the sum over all products whereas sum(sales) only computes sales for a particular product.

Regards,

Xue Bin

Not applicable

Hi,

Michael's expression should work.sum(total sales) forces the sum over all products whereas sum(sales) only computes sales for a particular product.

Regards,

Xue Bin

alec1982
Specialist II
Specialist II
Author

Thank you guys.

Somehow it wasn't workking yesterday. I t is working as wanted.

Regards,

Alec

ioannagr
Creator III
Creator III

Same here, 

 

 

any idea why this is happening?