cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnanthKS
Regular Visitor

Cumulative Balance and Month-on-Month Values

Hello everyone,

 

I'm trying to create P&L and Balance Sheet from Enterprise Software records - that is, taking the system-dump for a certain time-period using appropriate tcodes, and then utilizing Power BI on the drill-down structure (BS/PL Category-Main Category-Account-SubAccount/etc.).

 

I have the following simplified main table of transactions for a plant/profit center, showing just 3 GL codes for the year:

Tables_Screenshot-01.jpg

 As you can see there's an accumulated balance for the entries.

 

How do I create a table in Power BI with the following month-on-month values for the year, in the following format?

 

Tables_Screenshot-02.jpg

 

The calculated table here can be used to make the P&L.

 

Negative Signs are due to convention used in the ERP. There is only 1 entry per GL in a month of the Financial Year, no duplicates.

How can we create the above calculated table?

 

Thank you.

1 ACCEPTED SOLUTION

Hi @AnanthKS ,

 

Please try the following formula:

 

Column = 
'Table'[Accum.balance]
    - CALCULATE (
        SUM ( 'Table'[Accum.balance] ),
        FILTER (
            'Table',
            'Table'[Date] = EOMONTH ( EARLIER ( 'Table'[Date] ), -1 )
                && YEAR ( 'Table'[Date] ) = YEAR (  EARLIER ( 'Table'[Date] ) )
                && 'Table'[GL Code] = EARLIER ( 'Table'[GL Code] )
        )
    )

vkkfmsft_0-1647422787041.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
v-kkf-msft
Community Support
Community Support

Hi @AnanthKS ,

 

Please try the following calculation column:

 

Column =
'Table'[Accum.balance]
    - CALCULATE (
        SUM ( 'Table'[Accum.balance] ),
        FILTER (
            'Table',
            'Table'[Date] = EOMONTH ( EARLIER ( 'Table'[Date] ), -1 )
                && 'Table'[GL Code] = EARLIER ( 'Table'[GL Code] )
        )
    )

vkkfmsft_0-1646988826350.png

 

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi, thanks for the reply. However, it seems the formula doesn't work past the first year in the transactions table. I think there must be a check every time a new year/financil year begins?

 

Please see the screenshot below (I've expanded the trial table now), there's a column called MTMBalance (Month-To-Month) for manual calculation for what should be the answer. CheckBalance is calculated column as per solution posted:

Capture-Mar 12-2.JPG

 

Hope we have a way around this.

Hi @AnanthKS ,

 

Please try the following formula:

 

Column = 
'Table'[Accum.balance]
    - CALCULATE (
        SUM ( 'Table'[Accum.balance] ),
        FILTER (
            'Table',
            'Table'[Date] = EOMONTH ( EARLIER ( 'Table'[Date] ), -1 )
                && YEAR ( 'Table'[Date] ) = YEAR (  EARLIER ( 'Table'[Date] ) )
                && 'Table'[GL Code] = EARLIER ( 'Table'[GL Code] )
        )
    )

vkkfmsft_0-1647422787041.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@AnanthKS , Please refer this video from Curbal, if that can help in getting this format

https://www.youtube.com/watch?v=IISYzTaIyu4



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Hi,

Unfortunately that video did not help.

I am trying to find a solution that can give me month-on-month values for all GL codes, for each applicable month. (That is, ome GL codes will appear only in say, month 4 of the FY, and will therefore not feature in months 1 to 3 transactions).

The ERP dumps the accumulated GL balance up to the "reporting period" of the selected FY.  On the other hand, I am trying to build both monthly P&L, and YTD P&L.

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.