Hi everyone,
I have the following issue. I created a measure using the SWITCH function similar to the one shown on the EDNA Course Financial Reporting w/PowerBI.
The table on PowerBI desktop takes a while to load but it works. However, when I upload the report to the PowerBI Web Service the table does not load and I’m getting the error message: “Resources Exceeded This visual has exceeded the available resources.”
Below is the syntax of the measure:
ER Selected Year Actual =
Var CurrentItem = SELECTEDVALUE( ERTempSum2[ER Items (Normalized)])
Var Result =
SWITCH( TRUE(),
CurrentItem = “Total Umsatz”, [Total Umsatz] ,
CurrentItem = “Total Aufwand”, [Total Aufwand] ,
CurrentItem = “Bruttoergebnis 1”, [Bruttoergebnis 1] ,
CurrentItem = “Bruttoergebnis 1 Marge %”, FORMAT( [Bruttoergebnis 1 Marge %], “0.00%” ) ,
CurrentItem = “Total Personalaufwand”,[Total Personalaufwand] ,
CurrentItem = “Total Personalaufwand / Total Umsatz”, FORMAT([Total Personalaufwand / Total Umsatz], “0.00%”) ,
CurrentItem = “Bruttoergebnis 2”, [Bruttoergebnis 2] ,
CurrentItem = “Bruttoergebnis 2 Marge %”, FORMAT([Bruttoergebnis 2 Marge %], “0.00%” ) ,
CurrentItem = “Total Übriger betrieblicher Aufwand”,[Total Übriger betrieblicher Aufwand],
CurrentItem = “Total Übriger betrieblicher Aufwand / Total Umsatz”, FORMAT([Total Übriger betrieblicher Aufwand / Total Umsatz] , “0.00%” ),
CurrentItem = “EBITDA”, [EBITDA] ,
CurrentItem = “EBITDA Marge %”, FORMAT( [EBITDA Marge %] , “0.00%” ) ,
CurrentItem = “Abschreibungen”, [Abschreibungen] ,
CurrentItem = “EBIT”, [EBIT] ,
CurrentItem = “EBIT Marge %”, FORMAT( [EBIT Marge %] , “0.00%” ) ,
CurrentItem = “Betriebsergebnis III (EBT)”, [Betriebsergebnis III (EBT)] ,
CurrentItem = “Unternehmensergebnis vor Steuern”,[Unternehmensergebnis vor Steuern] ,
CurrentItem = “Direkte Steuern”, [Direkte Steuern] ,
CurrentItem = “Jahresergebnis”, [Jahresergebnis] ,
BLANK()
)
RETURN
Result
I read the SWITCH function is an expensive function but it can be that the above measure requires so much memory or the problem lies somewhere else? I have a Pro Licence and the Error message says consumed memory 1024 MB, memory limit 1024 MB.
The report page has one table and the table has only this measure (please see screenshot attached).
I would really appreciate any inputs, suggestions or changes to the measure to make it more efficient. If indeed the measure consumes so much memory, is there another way/technique to recreate a P&L with aggregation lines, % of total, etc. without using the SWITCH function?
Thank you!
Mariano