10 Replies Latest reply on Oct 22, 2018 5:52 AM by Jeo Thomas

# Percentage of total suppliers

I want to display the percentage of total supplies when applied a filter

For that, I have created two calculated fields

Calculated field 1. Count of suppliers - "COUNTD([Supplier Name])"

Calculated field 2. Total suppliers fixed - "{COUNTD([Supplier Name])}"

Using these calculated fields I tried to calculate the % of suppliers

Calculated field 3. % of Total Suppliers - "[Count of Suppliers]/{[Total suppliers Fixed]}"

But it is giving an error, below is the screenshot of the error.

regards

Jeo Thomas

• ###### 1. Re: Percentage of total suppliers

Good morning

you are getting that error because the LOD returns values that are not aggregated - you need to aggregate the denominator with sum(), min(),Max() or some other aggregation depending on your viz and analysis goals

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• ###### 2. Re: Percentage of total suppliers

Hi Jeo,

try sum([total suppliers fixed])

• ###### 3. Re: Percentage of total suppliers

Hi Jim,

I tried to aggregate the denominator using SUM() but now it is giving me the below error.

• ###### 4. Re: Percentage of total suppliers

If you use LOD then you'll have use any aggregation function with it like SUM, AVG or anything.

Try with this:-

[Count of Suppliers]/ {COUNTD([Supplier Name])}

• ###### 5. Re: Percentage of total suppliers

remove the { } braces

• ###### 6. Re: Percentage of total suppliers

the denominator should be     sum([total supplier count])

do not include the braces

• ###### 7. Re: Percentage of total suppliers

I removed the braces and that took the error away, thank you.

but the percentage doesn't change when I click on any filter.

Attached herewith in a GIF image for your reference

• ###### 8. Re: Percentage of total suppliers

try changing your calculation to this

COUNTD([Supplier Name])/TOTAL(COUNTD([Supplier Name])),

I guess this will work. If not, can you share a sample workbook?

Thanks,

Soham

• ###### 9. Re: Percentage of total suppliers

Hi Soham,

I have tried the above calculation but unfortunately, it didn't work, I have uploaded the sample workbook below is the link to the file

Regards

Jeo Thomas

• ###### 10. Re: Percentage of total suppliers

jeo.thomas wrote:

Hi Soham,

I have tried the above calculation but unfortunately, it didn't work, I have uploaded the sample workbook below is the link to the file

Regards

Jeo Thomas

Did you get a chance to look at the file?

Regards

Jeo Thomas