Hello friends,
I am a newcomer who is trying to design an app to overview energy consumption of factories. I have three screens which are the main screen, the list view and the details screen. I have achieved to design last to screens but I am stuck on something on the main screen.
Right now I have three tables; one for list of users which name, e-mail, and department information, another table for general energy consumption of all factories, and the final one is a summary table which shows average energy consumption etc. The idea is that when someone who works at a specific factory he/she should be able to see his/her consumption data on main screen, likewise when someone on energy department like me launch the app, he/she should see summary table. I have tried to do this with an If case but have failed to do so. I am sharing a screenshot below for better understanding.
The if case I am trying to work around is:
If(
dpt="Enerji", // dpt is the text box which gets the user mail and prompts department name
Özet, // this is the summary table
dpt="Üretim", // when department is equal to "production" I want to switch to the table below
Dağılımlar, // this is the consumption table of factories
)
dpt is a control type value however "Enerji" or "Üretim" are texts so I know it is not right to equalize
these two values but I do not know how can I both get department name from a table dynamically and compare
this data to select a table.

Thank you in advance,