Forum Discussion

hanssonnor's avatar
hanssonnor
Frequent Visitor
5 years ago
Solved

Problems with using more than one relationship

Hi,

 

I am currently struggeling to solve one issue.

In my data model I have various tables with active and inactive relationsships. In this case its about the following three tables:

 

 

Workbench (Sourced out of ERP)

Work Order Time Transaction (Sourced out of ERP)

Calender Table (Created)

 

The active relationships are the following:

 

Workbench - Work Order Time Transaction = 1:n  --> there are multiple lines for each work order

Calender - Workbench = 1:n --> Date of calender is linked to Start Date of Workbench

 

The inactive relationsship are the following:

Workbench - Calender = n:1 --> Date of calender is linked to G/L Date of Workbench. Hence for each transtions line in the Work Order Time Transaction, there is a Date for it

There are multiple other inactive connections between Calender (Date) and Workbench (Requested Date), (Status Changed) etc.. but those are not important for the measure.

 

I want to measure for each Workorder that is part of the Workbench the quantity that was completed on the date that is stored in the specific line in the Work Order Time Transaction. If I use my current measures, it will always link it to the active relation from Workbench to Calender. But this is not the correct one. Enclosed an overview of the data and the desired result.

 

Work Order Time Transaction

G/L DateWork OrderReason CodeQuantityOperations Number
121026502035461G10.00010
121027502035461G7.50020
121030502035461G6.00040
121035502035461G5.00050
121045502035461G4.50060
121046502035461G4.00070
121047502035461G3.50080

 

Workbench

Work OrderStart Date
5020354615.01.2021

 

Calender

DateJulian Date

 

My desired outcome would be the following:

 

Work OrderOperations NumberQuantityDate
502035461010.00026.01.2021
50203546207.50027.01.2021
50203546406.00030.01.2021
50203546505.00004.02.2021
50203546604.50014.02.2021
50203546704.00015.02.2021
50203546803.50016.02.2021

 

However with the current measures that I am using, the date is always reflected based on the Workbench - Calender relationsship.

But to get those results, the relationsship between Workbench and Work Order Time Transaction has to be active, Work Order Time Transaction and Calender as well, while Workbench - Calender needs to be "deactivated".

 

The measure I started using should gives me the final quantity of the picked operations process but at the date of the Start Date from the work order.

 

 

 

End Quantity Process = 

VAR Prozessschritt = SELECTEDVALUE('Work Order Time Transactions'[Operations Number],BLANK())
Return

    SUMX (
        'Workbench',
        CALCULATE (
            MIN ( 'Work Order Time Transactions'[Quantity] ), 
            KEEPFILTERS ( 'Work Order Time Transactions'[Reason Code] = "1G" ),
            KEEPFILTERS ( 'Work Order Time Transactions'[Operations Number] = Prozessschritt),
                    )
    )

 

 

 

If I add USERELATIONSHIP, I don't get any result.

 

I hope I explained my problem, in case you require more details please let me know.

 

Thanks in advance for your help/input/recommendations.

 

Best regards

Hanssonnor

2 Replies

  • hanssonnor's avatar
    hanssonnor
    Frequent Visitor

    jdbuchanan71 sorry for my late reply and thanks for your help. I also noticed that in contrast to my initial thought my connection between the Work Order Time Transaction and Calender were not mapped correctly. I changed that and using the CROSSFILTER, I finally get the results that I needed.

     

    Best regards

    Hanssonnor