Forum Discussion
MAX MIN
Min Stock = MIN(StockTable[Stock])
Office with Min Stock = CALCULATE( LASTNONBLANK(StockTable[Office], 1),
FILTER( StockTable, StockTable[Stock] = MIN(StockTable[Stock]))
Max Stock = MAX(StockTable[Stock])
Office with Max Stock = CALCULATE( LASTNONBLANK(StockTable[Office], 1),
FILTER( StockTable, StockTable[Stock] = MAX(StockTable[Stock]))
- pstanek10 years agoPost Patron
Is LASTNONBLANK supported in direct query?
- Anonymous10 years agoNot applicable
pstanek I don't think so. If your offices are numbered you could use MAX(StockTable[Office]) instead of LASTNONBLANK. If Office is a text field
maybe something like CONCATENATE(StockTable[Office], "")I am not sure what to do about that. You need some way to get a single row value and LASTNONBLANK/FIRSTNONBLANK is the only way I know of for that.- Anonymous10 years agoNot applicable
Figured it out. I was close with CONCATENATE but not quite right.
Office with Min Stock = CALCULATE( CONCATENATEX(VALUES(StockTable[Office]), StockTable[Office],
FILTER( StockTable, StockTable[Stock] = MIN(StockTable[Stock])