[23.102] Then as for him whose good deeds are preponderant, these are the successful.
[23.103] And as for him whose good deeds are light, these are they who shall have lost their souls, abiding in hell
Denkard, Book Five 9:2
Of what manner now are Heaven and Hell? Heaven begin. with the exalted Satarpaya, and Hell is below the surface of the earth. Heaven is luminous, fragrant, bliss-giving, and possessed of all sorts of brilliancy and charm. Hell is dark, full of wretchedness, stinking, lusterless, and given to every misery. In these (Heaven and Hell) there are many sort, of double bliss and double misery respectively. (Such bliss and misery) exist not on the earth that hes between. In the abodes of Satarpaya and Hamistagan are (the souls) both (of) the departed and the dead* having in them an admixture (of merits and sins.) Of them he that has the preponderance of righteousness has the passage to Heaven (i.e. to Satarpaya), while he whose sins are in excess is on the pathway to Hell; and he whose sins and meritorious deeds are in equal proportion has his abode in Hamistagan. What sorts of abodes are there in these three places of different grades? Of these sorts -the first full of bliss and charm, the second devoid of happiness and full of misery, and the third having a combination of the (awards of) righteous purity and sin.
This concept in Islam about going to heaven or hell based the ratio of good deeds vs bad deeds is just a borrowed belief from the Persians.