Forum Discussion

TaylorLowrey's avatar
TaylorLowrey
Frequent Visitor
6 years ago

Need help retrieving max value based on criteria

I am attempting to determine where in my facility a particular run is currently at.

I have multiple tables generating from different systems and I have created relationships between these tables. I assumed that I could put the values into a matrix and they would cross filter, however, I am always getting the max value of the entire related table as opposed to the max value of the rows which include the Run #.

Run Location Status Prod Run Table Expected Result Actual Result
           
           
LocationStatus Run  RunStatus RunStatus
A1 123A 1233 1234
B2 123A 1254 1254
C3 123B      
D4 123C      
   125A      
   125C      
   125D      

 

Any Idea's?

2 Replies

  • I would make the following Measure:

    MaxStatus = CALCULATE( MAXX( ProdRunTable, RELATED( RunLocationStatus[Status] ) ), ALLEXCEPT( ProdRunTable, ProdRunTable[Run] ) )

    Here are the tables / columns I made and the result:

    • TaylorLowrey's avatar
      TaylorLowrey
      Frequent Visitor

      That ended up giving me the same thing that I have been getting, however I do believe that I found a solution. 

      LastArea = calculate(
      max(RunLocationStatus[Status]),
      ALLEXCEPT(RunLocationStatus,RunLocationStatus[locationName]))
       
      My next endeavor will be to learn how to then take a count of that measures results.