Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Getting the maximum value for each order

Hi all,   Quite often I run into an issue regarding my relationships between tables.   In this case I have information on production orders, processes and quality in three different tables. They ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi all,

     

    I managed to solve it through af combination of the suggestions posted in the thread.

    Thanks to everyone for inputs!

     

    The solution for the time of controls was:

    FirstControl =
        MINX (
            TOPN (
                1, 
                'QualityControl', 
                'QualityControl'[CheckedDateTime], 
                DESC 
            ), 
            'QualityControl'[CheckedDateTime] 
        )
    
    SecondControl = 
        MINX (
            TOPN (
                2, 
                'QualityControl', 
                'QualityControl'[CheckedDateTime], 
                DESC 
            ), 
            'QualityControl'[CheckedDateTime] 
        )

     

    As I actually needed the five latest times of control I just increased the TOPN value for each measure.