Game of Thrones has seen the end of many of its royal families (R.I.P. to the Tyrells and the Freys) but no family in Westeros has fallen as far as the Lannisters. The Lannisters used to be the most powerful family in Westeros, but now there's only one Lannister remaining, and he may not live to the end of the finale. Tyrion's story on Game of Thrones is coming to the end, and from what fans know of what happens to Tyrion in the A Song Of Ice And Fire books, it seems likely that Tyrion's end in the books could be very similar to his ending in the television show.
Tyrion's characterization in GoT is fairly different from the man readers meet in ASOIAF. The Tyrion of the books is embittered, and often has cruel thoughts that don't match the kind, considered man seen in the show. However, despite the difference in personality, Tyrion's story in the books so far matches up with Tyrion's plot in the show for the most part — although, like most adaptations, a few elements of Tyrion's story got cut out in the transition between mediums.
The last that readers saw of Tyrion in the books, he was one his way to meet Daenerys — which, as fans of the show now know leads to the destruction of King's Landing.
At the end of The Dance Of Dragons, the last published ASOIAF book, Tyrion has not yet formally met Daenerys, although they are in the same proximity. Tyrion is in Essos, specifically Mereen, after having been kidnapped by Jorah. Jorah and Tyrion join up with another dwarf by the name of Penny and get brought to the fighting pits where Tyrion and Penny are scheduled to be devoured by lions for the entertainment of others. Daenerys, overseeing this, ends the fight and spares the two. The trio then join the Second Sons sellsword company, who are currently contracted to fight against Daenerys but Tyrion plans to get them to fight for Daenerys instead.
While there's no indication of what happens next in ASOIAF, there's a good chance that the Tyrion that goes on to meet Daenerys in the books may not be the same kind of advisor that Tyrion is on the show. The dynamic between Show Tyrion and Daenerys was often one of restraint, with Tyrion often telling Dany that she shouldn't kill everyone and try to act diplomatically — an advisement that has worked well on some occasions and has been completely ignored at other times.
However, the Tyrion of the books may want to see King's Landing burn just as badly as Daenerys does. The torment and humiliation of his trial in King's Landing still swirls around in his head by the end of A Dance With Dragons, and his violent fantasies about his sister may manifest in an attempt on her life. Should A Song Of Ice And Fire also end with Daenerys taking a dragon to King's Landing, it's entirely possible that Tyrion will be cheering her on instead of begging her to stop.