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
JoycevanWijk
Frequent Visitor

Switch function financial statement - multiple levels

I am building a profit and loss in PowerBI and I'm using a book and youtube tutorials from datatraining.io. 

 

I have a financial statement structure that contains 2 levels. 


Like this:


JoycevanWijk_0-1701081382413.png

 

I have individual measures calculating the level 1 items. 

Now I want to create a matrix with in the rows the level 1 and level 2.  The column months. 
And the values are the realisation of the rows per month. 

I copied a measure from the book, but in the book there is only one level. So I understand that I need to do something to check if it is a level 1 or level 2 item, and then switch. Right now with this measure the level 1 row is empty and all the level 2 values are shown. 

Realisatie =
Var Keuze = SELECTEDVALUE('Financial Statement Structure'[Line Item ID])
Return
SWITCH(TRUE(),
Keuze = "Omzet", [Omzet Totaal],
Keuze = "Inkoopkosten omzet", [Inkoopkosten Omzet Totaal],
Keuze = "Variabel personeel", [Variabel Personeel],
Keuze = "Operationeel resultaat", [Operationeel resultaat],
Keuze = "Bedrijfsresultaat", [Bedrijfsresultaat],
Keuze = "Resultaat voor belastingen", [Resultaat voor belastingen],
CALCULATE([TOT_BEDRAGEN], FILTER(KOPPELING, KOPPELING[OmschrijvingSubCategorie]=Keuze)))

The financial statement structure does not have any relationship to other tables. 

There is also a table called koppeling, this has 2 columns (Level 1 and level 2). This table is connected to the financial data. 
 
So how do I rewrite the measure so that it shows the totals at level 1 and values at level 2?
 
I feel it should be easy, but I'm not getting it to work. Thank you so much for your help!



 

1 REPLY 1
JoycevanWijk
Frequent Visitor

No one? 😞

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.