Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
i am preparing balance sheet using matrix, all rows comes from data table. i stuck when i want to add profit for the year in UNAPPROPRIATED PROFIT (Which is calculated with the help of dax.) how can i add this as row and include in balance sheet
Hi @atifkazmi1980 ,
I am assuming that your organization does not use an ERP system that automatically generates the balance sheet from recorded transactions. Typically, ERP accumulate balances for GL accounts mapped to the balance sheet, while for GL accounts mapped to the profit and loss (P&L) statement, they only accumulate balances for the current year. At the end of the year, the net profit or loss is transferred to the retained earnings (unappropriated profit) line which is part of BS accumulated balances.
To replicate this logic, you can use a Calendar table, a Transactions table containing journal entries (where debits and credits sum to zero), and an additional GL_Mapping table. The GL_Mapping table should classify each GL account into either "BS" (Balance Sheet) or "PL" (Profit and Loss). Relationships should be created as follows:
We calculate the balances as follows:
1. Cumulative Sum for Balance Sheet Accounts
BS_Cumulative =
CALCULATE(
SUM(Transactions[Amount]),
FILTER(
ALL(Calendar),
Calendar[Date] <= MAX(Calendar[Date])
),
GL_Mapping[GL_Type] = "BS"
)
2. Year-to-Date Sum for Profit and Loss Accounts
PL_YTD =
CALCULATE(
SUM(Transactions[Amount]),
DATESYTD(Calendar[Date]),
GL_Mapping[GL_Type] = "PL"
)
3. Retained Earnings Filtered by the GL Account
Retained_Earnings =
CALCULATE(
SUM(Transactions[Amount]),
FILTER(
Transactions,
GL_Mapping[GL_Type] = "PL" &&
YEAR(Transactions[Date]) < YEAR(MAX(Calendar[Date]))
),
GL_Mapping[GL_Account] = "Retained Earnings"
)
Explanation of the Logic:
By explicitly filtering for the "Retained Earnings" GL account in the retained earnings calculation, we ensure the correct accumulation of net profit or loss into the designated retained earnings line. This approach is scalable and flexible, as changes in GL classifications can be managed directly in the GL_Mapping table.
Best regards,
Thanks. now i created calculated column with the name of profit for the year and value calculated is correct. but unable to show in balance sheet. is there any solution to acheive desire result. i am very new to power bi
Best regards
Hello @atifkazmi1980 ,
Actually, if you create calculated column you can put the the column in the values.
To find out the problem could you show me with example? It can be visualization or pbıx file.
Best Regards,
Gökberk Uzuntaş
LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/
Medium: https://medium.com/@uzuntasgokberk
İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.
Hello @atifkazmi1980,
İf you are using matrix visualization in Power BI. There are rows, columns and Values in Format Pane.
And your measure "UNAPPROPRIATED PROFIT" can be used only in values. Because measure can be only used on Values. But if you created Calculated column you can use on rows and column. However, it will be shown without aggregated.
Best Regards,
Gökberk Uzuntaş
LinkedIn: https://www.linkedin.com/in/g%C3%B6kberk-uzunta%C5%9F-b43906198/
Medium: https://medium.com/@uzuntasgokberk
İf this post helps, then please consider Accept it as solution and kudos to help the other members find it more quickly.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.