Forum Discussion
TaylorLowrey
6 years agoFrequent Visitor
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 | |||||||
| Location | Status | Run | Run | Status | Run | Status | ||||
| A | 1 | 123 | A | 123 | 3 | 123 | 4 | |||
| B | 2 | 123 | A | 125 | 4 | 125 | 4 | |||
| C | 3 | 123 | B | |||||||
| D | 4 | 123 | C | |||||||
| 125 | A | |||||||||
| 125 | C | |||||||||
| 125 | D |
Any Idea's?
2 Replies
- BekahLoSurdoResolver IV
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:
- TaylorLowreyFrequent 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.