How do I design a Dimension and Fact Table from a relational database?
First, I suggest you read about star schema first. Not understanding the concepts could lead to wrong results.

You may use the transaction as your fact table as in the diagram below.

Don't use DISTINCT, instead you want to use:

SELECT ... FROM fact GROUP BY dimension data (time, transaction and bank)
WHERE condition to restrict dimension data and join with fact.