The LORD passed before him and proclaimed, “The LORD, the LORD, a God merciful and gracious, slow to anger, and abounding in steadfast love and faithfulness,  keeping steadfast love for thousands, forgiving iniquity and transgression and sin, but who will by no means clear the guilty, visiting the iniquity of the fathers on the children and the children’s children, to the third and the fourth generation.”
Verse 6 talked about who God is in terms of his identity and character. In verse 7 God proclaims what he does because of who he is. Because he is merciful, gracious, slow to anger, and abounding in steadfast love and faithfulness, he [keeps] steadfast love for thousands, [forgives] iniquity and transgression and sin. This is how his mercy, grace, patience, love, and faithfulness are displayed and expressed. God perseveres in love. He forgives sins and sinners. That’s his goodness which is the apex of his glory.
But this goodness is unintelligible and non-existent without his justice and righteousness that is also upheld. Therefore not only does he persevere in love and repeatedly forgive, but [he] will by no means clear the guilty, visiting the iniquity of the fathers on the children and the children’s children, to the third and the fourth generation. This is the righteousness of God. But “righteousness” or “justice” is not part of the “name” or “glory” of God proclaimed to Moses in verse 6. Why mention God visiting the iniquity (“bringing the consequences”, CSB) in this proclamation of God’s goodness? I think there’s two parts to this answer. First, God’s goodness seen in his “mercy, grace, patience, love, and faithfulness” is only that in connection with his bringing the righteous consequences on the guilty. So, if God did not punish the guilty then mercy would not be mercy, grace would not be grace, and love would not be love. Paul writes in Romans 9:22-23, “And what if God, desiring to display His wrath and to make His power known, endured with much patience objects of wrath ready for destruction? 23 And what if He did this to make known the riches of His glory on objects of mercy that He prepared beforehand for glory” (CSB). God displays his wrath “to make known the riches of his glory” on objects of mercy. God’s mercy could not be known without God’s righteous wrath. Now God’s glory is supremely seen in his goodness (mercy, grace, love, faithfulness), and that is made known by God displaying his wrath.
Second, if all were forgiven we wouldn’t feel the grace. If none were punished then we would not know the glory of mercy. We would feel like we deserved to be in God’s presence and kingdom forever not by virtue of God’s mercy per se, but by virtue of our being human. If God were to be glorified and celebrated for his mercy toward sinners, than his judgment toward other sinners is the wisest way to communicate that mercy.
 It could not be “known” for one of two reasons: (1) mercy would be unintelligible though existing, or (2) mercy would cease to exist if justice/wrath did not exist. I think it’s the second reason since all of God’s characteristics and actions are held together and interdependent in various ways. So I take the inability to “know” God’s mercy as the impossibility of knowing mercy because mercy would cease to exist.
 It’s assumed that the cross of Christ is included in the way to communicate the glory of God’s goodness to us, but God clearly thinks it best to communicate his mercy not only by contrast with Christ’s propitiation, but with unbelievers’ eternal condemnation.