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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Need help with opening balance

Hi,

 

I am having issues getting a measure right, I tried to look on the forums and google but I can't seem to find something that works.

 

So this is my situation:

 

I have a table with opening balances for different catagories

Let's use the below as an example:

CatagoryYearOpening Balance
120181000
220202500
320203000

 

I have a different table with the catagory:

 

CatagoryCatagory CodeCatagory Description
10040Personal Bank Account
20283Customer Invoices

 

Transaction (fact) table:

Entry numberAmountCatagory CodeDate
231300501-02-2019
3453500,50205-06-2017
343200120-10-2018

 

And I have a date table.

Fact table is connected to catagory and date table

Opening balance table is connected to the catagory table

 

What I need at the end is a barchart and a table visual to see how everything changes per month, taking the opening balance in account for each year.

 

I can get a table with all the values without measure no problem, relationships seem to work fine.

 

Thank you in advance for your help!

 

My previous topic got marked as spam? Not sure why it was deleted..

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , In opening balances  you can create a date like

 

Date = Date([Year],1,1)

Join it with date and Catagory too

You can use YTD from both opening balances and Transaction and add it.

 

YTD = CALCULATE(sum(Opening Balance[Opening Balance])+ sum(Transaction[Amount]),DATESYTD('Date'[Date],"12/31"))

 

 

Power BI — YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , In opening balances  you can create a date like

 

Date = Date([Year],1,1)

Join it with date and Catagory too

You can use YTD from both opening balances and Transaction and add it.

 

YTD = CALCULATE(sum(Opening Balance[Opening Balance])+ sum(Transaction[Amount]),DATESYTD('Date'[Date],"12/31"))

 

 

Power BI — YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak can you maybe help me with one more thing regarding this?

I tried to put a filter in the measure, but then everything bundles into january, if I have no filter it shows in all months. Do you know how to fix that?

 

 

CALCULATE(SUM(BalanceLines[OPEN])+SUM(TransactionLinesBulk[Bedrag]),DATESYTD(Dates[Date],"31-12"), 
FILTER(GLAccountClass, LEFT(GLAccountClass[ClassificationCode],4)="BIva" || 
LEFT(GLAccountClass[ClassificationCode],4)="BMva" || 
LEFT(GLAccountClass[ClassificationCode],4)="BEff" || 
LEFT(GLAccountClass[ClassificationCode],4)="BLim" || 
LEFT(GLAccountClass[ClassificationCode],4)="BFva" || 
LEFT(GLAccountClass[ClassificationCode],4)="BVor" || 
LEFT(GLAccountClass[ClassificationCode],4)="BVrd" || 
LEFT(GLAccountClass[ClassificationCode],4)="BPro"  ))

 

 

Measure 3 without filter

Measure 2 with filter (also marked yellow underneath)

save23.png

 

Anonymous
Not applicable

I think that did the trick, thank you! @amitchandak 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.