Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Everyone,
I have tried many different approaches and nothing is working as of right now.
I'm trying to automate a financial report for the accounting team. I'm importing information from SQL.
My table looks something like this.
| accountnumber | last day of year | janbalance | febbalance | store # |
| 100 | 12/31/2021 | -1400 | -1100 | Store - A |
| 153 | 12/31/2022 | -2854 | -9874 | Store - B |
| 201 | 12/31/2022 | -741 | -854 | Store - B |
While I wish dates were there own column to help with filtering. Im nervous on transforming the data due to this being money and second data validation is already an issue and I like to rule that out right away. However if this result needs transformation to help make the project easier I'm open to that solution.
My desire is that it will sum the balance for the month based on the account and store conditions.
I would first create two new dimension tables: Accounts and Stores.
Since you're using SQL, it should be something akin to
SELECT DISTINCT accountnumber AS "Account Number" FROM TABLE
SELECT DISTINCT store# AS "Store #" FROM TABLE
Then, create a relationship between these tables and the appropriate columns in the fact table above.
Next, as you suspected, I would reccomend transforming the fact table.
In powerQuery, you can do something like:
= Table.AddColumn(#"Changed Type", "Year-Month", each Text.Combine({Text.From([Month], "en-US"), "/1/", DateTime.ToText([Last day of the year], "yyyy")}), type date)
Then, connect it to the "Year-Month" column we've just created.
Now you're set!
SUM the Balance column, while using the accounts, stores and calendar tables we created (instead of the columns in the fact table).
I hope it works!
First, thank you. Rewriting my SQL query and performing some transformations helped shape the data. So for my delayed appreciation as many other challenges come up during this project that required additional time.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 14 | |
| 12 | |
| 9 | |
| 8 | |
| 7 |