Percentage 0 error

IF(
[Pair types] = "used pair",
([Quantity] / SUM(SELECT(scan sheet [Quantity], [Pair types] = "used pair"))) * 100,
0
)

Percentage calculation showing "0"

Solved Solved
0 6 106
1 ACCEPTED SOLUTION

6 REPLIES 6

Please try 

IF(
[Pair types] = "used pair",
([Quantity]*1.00 / SUM(SELECT(scan sheet [Quantity], [Pair types] = "used pair"))*1.00) * 100.00,
0
)

SUM(SELECT(SCAN SHEET[Quantity], [PAIR TYPES] = "Used pair")) / SUM(SCAN SHEET[Quantity]) * 100

 

But showing results "0" please me


@Sirfyaad wrote:

SUM(SELECT(SCAN SHEET[Quantity], [PAIR TYPES] = "Used pair")) / SUM(SCAN SHEET[Quantity]) * 100


Thank you for your Response @Suvrutt_Gurjar 

Please tell me why the error is showing here. If I have made any mistake in the expression, please correct me. 

Please take a look at the tip by @Steve . He has explained it very well why it results in 0

Suvrutt_Gurjar_0-1695532169117.png

Please make your column type decimal and please try the below expression.

SUM(SELECT(SCAN SHEET[Quantity], [PAIR TYPES] = "Used pair")) / SUM(SCAN SHEET[Quantity]) * 100.00

or try the following

SUM(SELECT(SCAN SHEET[Quantity], [PAIR TYPES] = "Used pair")) /DECIMAL( SUM(SCAN SHEET[Quantity]) * 100)

 

Please try 

(SUM(SELECT(SCAN SHEET[Quantity], [PAIR TYPES] = "Used pair")) /DECIMAL( SUM(SCAN SHEET[Quantity])))* 100

 

In the earlier expression shared by you, I think the multiplication by 100 was happening just to the denominator, One needs to multiply by 100 to the entire result.

Top Labels in this Space