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]))
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])
- pstanek10 years agoPost Patron
Thanks, It works for some examples.
I have another idea, but I dont know , if it is possible.
Can I sort table by levels? I have table within report. I would like to sort it by product, and second level by office. Is it possible?
I need to find solution, when stock table exists only within report, but it is not in query. I mean it has been created through relations.