Forum Discussion
MAX MIN
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.
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.
- Anonymous10 years agoNot applicable
Hi pstanek,
Do you want to sort the table in Report view or Data view of Power BI Desktop? Could you please show sample data of your table and post the expected result?
Thanks,
Lydia Zhang- pstanek10 years agoPost Patron
It is similar to this , so I tried to use its solution. Using Matrix
https://community.powerbi.com/t5/Desktop/Sort-a-table-by-the-results-of-two-columns/m-p/16299#M4485