Goodday all,
I have a powerapp with a Name , Timeloss These 2 dropdowns are irrelevant for this question. The other dropdowns are relevant.
See ERD/Powerapp below.
I have written placeholders in the place off sensitive data.
PowerApp:

Reason id's are dependent on the category infront of it.
ERD:

I can't seem to get the reason id correct.
in this instance reason_category_2 and _3 are empty and when empty instead of giving the reason id it gives a 1.
Any way to be garantueed to get the correct id? I am so confused by some of this.
There are no duplicate rows. See table example data:

Bassicly what i'd need is to be able to base 1 dropdown off 5 others somehow. Kind of like a hierarchy as seen below. If i would be able to make 1 dropdown with these 5 values i could depend the reasons_id on this one hierarchy dropdown.
budget_cat
budget_subcat
reason_cat1
reason_cat2
reason_cat3