Paul, yes, exactly, the report I showed is inspired by the Gainstrack P&L Explainer <https://www.reddit.com/r/plaintextaccounting/comments/19c1xv7/comment/kj65xs4/?utm_name=web3xcss>, but initially to be able to explain my P&L was the sheer reason I came to beancount from Gnucash 7 years ago <https://groups.google.com/g/beancount/c/CIhT0jrlqI4/m/SEtok-T0CAAJ> and largely due to this reason I learned python.
I think if you use the *sing_curr_conv <https://github.com/Ev2geny/evbeantools/blob/main/docs/sing_curr_conv.md>*tool as a plugin <https://github.com/Ev2geny/evbeantools/blob/main/docs/sing_curr_conv.md>, I see no reason why you would not be able to see the unrealized gains in Fava (I need to experiment with this). However I agree, in order to show unrealized gains, I had to do some changes to ledger (like converting everything to a single currency), so you lose some information (as explain in the Appendix A here <https://github.com/Ev2geny/evbeantools/blob/main/docs/sing_curr_conv.md#appendix-a-converting-entries>). This is because unrealized gains only make sense, when you convert things to some target currency. And once things get converted to a single currency, you have to make some changes to ledger for it still be valid. Any way, whilst the *sing_curr_conv *is not perfect (but still shall be workable) to be used in Fava, it fits very nice to be used in a notebook (Jupyter or Marimo, as I yesterday learned). This is because in a notebook nothing prevents you from having several set of ledger entries: the initial one, as well as converted to a single currency with *unrealized *gains. For me personally I use main ledger for bulk analysis and the ledger, converted to a single currency to analyze unrealized gains, as well as what I call hidden gains <https://github.com/Ev2geny/evbeantools/blob/main/docs/sing_curr_conv.md> It shall be perfectly possible to use *sing_curr_conv *to do a breakdown Realized+Unrealized gains per investment (per commodity, I assume). Unrealized gains per commodity are encoded in the unrealized gains Income name: e.g. in this case this is IVV Income:Unrealized-Gains:USD-IVV -100 USD See example <https://github.com/Ev2geny/evbeantools/blob/main/docs/how_sing_curr_conv_works.ipynb> Realized gains per commodity you will have if you log them correctly e.g. Income:Investment:IVV But I do not think, that it will be easy to do in Fava. Fava is great, but in my view it is much less hackable, whilst the data analysis with pandas is extreamly flexible. You can effectively extract anything, create any report and any analytics, provided the data is available. And this is what the *sing_curr_conv *does. It provides you data (in a form of an unrealized gains account name as well as in a form of the SCC_Metadata <https://github.com/Ev2geny/evbeantools/blob/main/docs/sing_curr_conv.md#scc_-metadata> ). On Thursday, March 12, 2026 at 9:22:06 AM UTC+1 Paul Schumacher wrote: > Hi there, > > Nice screenshot, it looks like you built a "PnL Explainer", which is > something I have been struggling with for a few months now, trying to > figure out the right way to do this without re-inventing the wheel. There > is a thread <https://github.com/beancount/fava/issues/1751> about this on > the Fava github. > > I started out building something like your screenshot in a Fava plugin, > but I wanted to breakdown Realized+Unrealized gains per investment, and I'm > still trying to figure that out. (sidebar: in the process I also looked at > your work > <https://github.com/Ev2geny/evbeantools/blob/main/docs/sing_curr_conv.md>, > but it seems to do too much for me). > > I have tried plugins like Fava Portfolio returns, but I'm looking for > something simpler, to look at a PnL difference over a period, next to other > income / expenses. > > My current conclusion was that maybe unrealized gains should show in the > income statement if the dropdown is set to "At Market Value" ? I didn't > quite get what the current use case for "At Market Value" on the income > statement is. > > Best Regards > > On Wednesday, March 11th, 2026 at 10:47 AM, Chary Ev2geny < > [email protected]> wrote: > > Hi, > > I know this is not exactly what you are looking for, but I was also > looking for ways to better visualize beancount data. I just decided to do > this in jupyter notebook, thus having access to all the modern data > processing and visualization tools, available there > > For instance I have so-called financial overview table (which may be > similar to what you are looking for). > > For the sample ledger, used in Fava for demo, > <https://fava.pythonanywhere.com/>it looks like this > > [image: Screenshot 2026-03-11 103700.png] > > > This is the proof that this matches Fava content > > [image: Screenshot 2026-03-11 103837.png] > > Note, that this report not only shows Income Statement as well as balance > sheet information per time period in one table, it also shows, that one > explains other. To make sure, that it is possible to explain the difference > in the net Worth Change I had to calculate unrealized gains (otherwise it > does not come together) > > You can then visualize this table like that > > Note: that I have chosen to show *Income *as a positive value, which in > my view makes i easier to compare it with expences > > [image: Screenshot 2026-03-11 104518.png] > > On Tuesday, March 10, 2026 at 11:55:28 PM UTC+1 Benjamin Debeerst wrote: > >> Hi there, >> >> I've been experimenting hacking on the Fava web interface in order to >> adapt it more to my needs. I think there is a possible path to unify the >> different existing reports into a single more powerful report that could >> fulfill existing needs while enabling additional use cases. Let me >> elaborate. >> >> A non-existing view in Fava that I would like to have for my monthly >> personal income and expenses review would be a combination of Income >> Statement and Account Report: The former allows to nicely compare expenses >> against income. But that report unfortunately does not have a time >> dimension: It only shows the total change in the filtered time range, and >> it is cumbersome to put a given month into a historical perspective without >> jumping around with the time filter. >> >> The Account Report can break down changes/balances on a monthly or weekly >> basis, allowing me to see how e.g. expenses for groceries and shopping of >> last month compare to how much I typically spend. The accompanying stacked >> bar chart is a great visual overview, but it only does so for a single >> account (tree) though. I've seen requests on the mailing list and in GH >> Issues to have an account report for multiple account (trees) at once, >> which is what I was looking for. >> >> I've been going through the Fava code to see whether I could hack >> something together that either adds interval balances (or changes) to the >> Income Statement or allows Account Reports for multiple accounts. At which >> point I realized that all tree reports (Income Statement, Balance Sheet, >> Trial Balance) already _are_ tree reports for multiple accounts - they just >> calculate a total instead of interval numbers. >> >> At this point I'm wondering whether it'd be worth working on a change >> where the classes TreeReport and AccountReportTree from >> src/fava/json_api.py are unified into a single new report class, reporting >> on a list of 1..n accounts, always reporting interval balances, optionally >> accumulated. The Income Statement would become an Account Report for >> Income and Expenses (not sure exactly how Net Profit could be modeled here >> yet), Balance Sheet an Account Report for Assets, Liabilities and >> Equity; Trial Balance an Account Report for Assets, Equity, Expenses, >> Income. >> >> If I want a total for a year or a month, I can select "yearly" as the >> interval and filter for a year. Or the interval selector gets and >> additional option "total". >> >> I think this could reduce some duplication in the backend and frontend >> code while enabling more custom reports and better graphs for the existing >> tree reports. >> >> Before diving into an implementation and potentially opening a PR, I >> wanted to hear thoughts from the community and/or maintainers about this >> idea and possible obstacles that I may have missed. Curious to hear y'all >> thoughts. >> >> Best, >> Benjamin >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To view this discussion visit > https://groups.google.com/d/msgid/beancount/5f1ce66c-e52a-496c-8bb7-1eadcdfc2a6dn%40googlegroups.com > . > > > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/beancount/6afa96e1-43bc-4c5d-acd7-82b37aac8bbbn%40googlegroups.com.
