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
Syndicate_Admin
Administrator
Administrator

ISINSCOPE problem

Good night

I am performing an income statement, which must contain the following structure:

Alonso_96_0-1664407270182.png

The graph above I use as a guide table for the structure. also create a formula for each row and group them by folders

Alonso_96_1-1664407348283.png

An example of the Sales formula is as follows:

Alonso_96_3-1664407404464.png

Alonso_96_2-1664407387197.png

The problem occurs to me when I want to use the following formula to combine all the data:

Final Value =
IF(ISINSCOPE(Estructura_[Level 2]),
SWITCH(
SELECTEDVALUE(Estructura_[Level 2]),
"Income for Works",[Sale by Works],
"Income from Services",[Sale for Services],
"Sale of Merchandise and Others",[Sale of Goods and Others],
"Cost per Works",[Cost for Works],
"Cost per Service",[Cost for Services],
"Cost of Merchandise and Others",[Cost of Merchandise and Others],
"MB Works %",FORMAT([MB Works %],"Percent"),
"MB Works with Liq. %",FORMAT([MB Works with Liq. %],"Percent"),
"MB Services %",FORMAT([MB Services %],"Percent"),
"MB Merchandise and Other %",FORMAT([MB Merchandise and Other %],"Percent"),
"Personnel Expense",[GG-Personnel Expenditure],
"Fee Holding",[GG-Fee Holding],
"Fee Qualys",[GG-Fee Qualys],
"General Expenditure",[GG-General Expenditure],
"% GG/Sales",FORMAT([GG / Sales %],"Percent"),
"Fines",[Other Expenses - Fines],
"Legal Claims (RC, Indecopi)",[Other Expenses - Legal Claims],
"Other Expenses",[Other Expenditures - Other],
"Bank Loans",[Financial Expenses - Bank Loans],
"Fine Asset Measurement. (GSP)",[Financial Expenses - Active Measurement],
"Measurement of Fin Liabilities. (RC / INDECOPI)",[Financial Expenses - Passive Measurement],
"Other Expenses",[Financial Expenses - Other Expenses]),
IF(ISINSCOPE(Estructura_[Level 1]),
SWITCH(
SELECTEDVALUE(Estructura_[Level 1]),
"Sales",[Sales],
"Cost of Sales",[Cost of Sales],
"GROSS PROFIT",[Gross Profit],
"Gross Margin %",[Gross Margin %],
"Overhead",[General Expenses],
"Other Income",[Other Income],
"Other Expenditures",[Other Expenditures],
"Utility Vta. Inv. In Subs.",[Utility Vta. Inv. In Subs.],
"OPERATIONAL UTILITY",[Operating Profit],
"Operating Margin %",FORMAT([Operating Margin%],"Percent"),
"Financial Income",[Financial Income],
"Financial Expenses",[Financial Expenses],
"Dividends received",[Dividends received],
"Participation in Associates",[Participation in Associates],
"Devaluation Effect",[Devaluation Effect],
"PROFIT BEFORE TAXES",[Profit Before Tax],
"Income Tax",[Income Tax],
"USEFULNESS OF THE EXERCISE",[Utility of the Exercise],
"Utility discontinued operations",[Utility discontinued operations],
"NET PROFIT FOR THE YEAR",[Net Income for the Year],
"Net Margin %",FORMAT([Net Margin %],"Percent"),
"Minority Interests",[Minority Interests],
"RESULT OF THE FINANCIAL YEAR",[Result of the Financial Year]
)))

When using this formula, certain parts of the structure appear correct to me, however, in the case of Profits and Margins that are divisions and are as measures in the same way, it does not show them to me:

Alonso_96_4-1664407550221.png

I don't know if anyone can help me with this problem. I am using a level of hierarchy Level 1 and Level 2 and the rest are measures.

Already verify that the names in the measure "Value" are as they are written in the tables and I can not think of what the error may be, please would appreciate your help.

Best regards

Alonso

3 REPLIES 3
HoangHugo
Solution Specialist
Solution Specialist

Hi,

Power BI uses case-sensitive text, so make sure the comparision to text type that is correct in each characters of text.

Level 1 is not sub cat, so you don't need to use ISINSCOPE

amitchandak
Super User
Super User

@Syndicate_Admin , Make sure Level 2 is below level one in Matrix. Share the formula which not working properly

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

Thanks for the answers, I found the error, it was that you didn't have to generate a relationship between tables for the formula mentioned above to work.

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.