
Announcements
Here's the scenario:
A dataverse table named "KORE_Kostenstellens" lists all existing cost centers in the rows. A choice column with the respective selection options (m², NumberOfEmployees, Workhours,... ) is stored as attribute or measurand. This is to determine which measure is used for the apportionment of the cost center. In addition, a separate column is defined for each existing measurement type, where the value of the measurement type for this cost center is stored. A cost center can have several measurands, but depending on which measurand is specified in the Choice column, the respective measurand column is to be accessed later. This is how it looks like (The very left column is the number of the cost center):
The goal is to allocate one cost center to another. A cost center can be allocated to one or to several cost centers. It must remain variable for the end user to which cost centers the cost center is apportioned. For this purpose, I have created additional columns where the number of the cost centers to be allocated is entered (U1, U2, U3,...).
From a mathematical point of view, the cost center to which the cost center is allocated must be calculated in this way:
Definitions:
- Cost center from which the apportionment is made: Sender cost center
- Cost center to which the apportionment is made: Receiver cost center
("€ of Sender cost Center" / "value of the measurement depending on the selected measurement type") * measurement of the receiver cost center depending on the selected measurement type of the Sender cost center".
How do I implement this in Power Apps in this scenario?
I already got the formula to get the correct Measurement of the sender cost center depending on the selected measurement type in the choice column and divided the €value of the sender cost center through it (works):
LookUp(
KORE_Betriebsabrechnung_Summe,
IsBlank(K020) = false,
K020
) / LookUp(
KORE_Kostenstellens,
Kostenstellennummer = 1,
Switch(
Messgröße,
Messgrößen.'m²',
'm²',
Messgrößen.Personal,
Personal,
Messgrößen.Betriebsstunden,
Betriebsstunden,
Messgrößen.Büge,
Büge,
Messgrößen.Gehänge,
Gehänge
)
... in this code, KORE_Betriebsabrechnung_Summe is the source of the € value of all cost centers. The values "KXXX" are the numbers of the cost centers in this source).
As a solution I could create an additional table where the sender cost centers are columns and the receiver cost centers are rows. Then I would use the ForAll(nonblankrows) formula to retrieve all the receiver cost centers of the sender cost centers, store this somehow as a variable, and then search in the "KORE_CostCenters" table and retrieve the measured variable value stored there. Again, this must be selected based on the selected measurement variable of the sender cost center. I would need this value to multiply the above formula by.
You see the whole thing sounds quite complex and extensive. Maybe someone can help me.
Cheers, Alex