Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TaylorLowrey
Frequent 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
           
           
LocationStatus Run  RunStatus RunStatus
A1 123A 1233 1234
B2 123A 1254 1254
C3 123B      
D4 123C      
   125A      
   125C      
   125D      

 

Any Idea's?

2 REPLIES 2
BekahLoSurdo
Resolver IV
Resolver 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:

MaxValue.PNG

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.