Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Keep Opening Balance for first month in filter and ignore the other months. Keep Transactions

ItemAmountFebMarApr
Op Balance1000110012031309.09
Transactions100103106.09109.2727

 

Hi Everyone,

 

I have the above data. I am trying to build a balance sheet. I am trying to keep it dynamic. I am hoping to create  a calculated column that has opening balance of first month in filter and sum of transactions in those months

 

So for example, If I select March and April balance sheet, it would keep March opening balance and sum of both months transactions.

 

Is it possible?

1 ACCEPTED SOLUTION
danextian
Super User
Super User

You can create measures like these:

 

Beginning Balance =
CALCULATE (
    SUM ( Journals[Amount] ),
    FILTER ( ALL ( Dates ), Dates[Date] < MIN ( Dates[Date] ) )
)

 

Ending Balance =
[Beginning Balance] + SUM ( Journals[Amount] )

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

You can create measures like these:

 

Beginning Balance =
CALCULATE (
    SUM ( Journals[Amount] ),
    FILTER ( ALL ( Dates ), Dates[Date] < MIN ( Dates[Date] ) )
)

 

Ending Balance =
[Beginning Balance] + SUM ( Journals[Amount] )

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

@danextian @amitchandak  Thank you your solution works great.  Now my next challenge is that i need to filter based on another table's field called fund name in fund table. I googled and tried to add another all except but i need to still only fetch the first date which is in date table. When i add the 'relational COA_Transactions'[Trx_Date] < MIN ( 'relational COA_Transactions'[Trx_Date])) in the second all except it gives an error. Would you kindly have a solution to this?

 

My Formula:

Beginning Balance =
CALCULATE (
SUM ( 'relational COA_Transactions'[Trx_Amount_Adj] ),
FILTER ( ALLEXCEPT(('relational COA_Transactions'),'relational COA_Transactions'[COA L1 Code], 
'relational COA_Transactions'[Trx_Date] < MIN ( 'relational COA_Transactions'[Trx_Date]))
)

 

amitchandak
Super User
Super User

You need to build for date <= till date

 

Sale_till_tody =CALCULATE(sum(Sales[Sales Amount]),filter(sales,Sales[Sales Date]<=maxx(Sales,Sales[Sales Date].[Date])))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.