They're only really similar in specific contexts.
For example, all the gold medals different countries have won at the Olympic Games.
- You can say "the table shows the medals per country", meaning that it shows how many medals each country has won.
- You can say "the table shows the medals by country", meaning that it shows a bunch of medals, that information is grouped in a certain way, and the way it is grouped is "which country won the medals".
If you have a table that shows the medals by country, I think it's implied that your table shows the medals per country as well. It doesn't directly mean the same thing, but it implies the same information. I'm not an accountant, but I think that's the context that's being discussed in that other question.