The Obama family earned & 20.5 million from 2005 to 2016, during this period he served as a senator and was later elected as the president of United States of America (USA).
A detailed analysis of his income of published by Forbes which detailed how he earned his salary as president, royalties from his books, & corporate boards.
During his presidency alone he earned 10.8 M, the breakup is as follows:
Salary: $3.1 Million
Dreams From My Father (Book): $4.5 Million
Audacity of Hope (Book): $3 Million
Miscellaneous (Dividends, etc) : $0.12 Million
Before coming into politics he earned $ 85,000 as a law professor, after becoming senator his yearly income increased to $ 2.4 Million, this was even before he become the president of USA. He also got fame from his charitable work but in reality he only gave 8% of his income in charity.