Min valuee of column (ignoring blanks, Nulls, zero)

  • Need to get the minimum non blank non zero column. Need the maximum but that's not the problem.

    How do I filter the column to ignore the value zero

    Thanks

    E

  • Would [font="Courier New"]WHERE somecolumn <> 0[/font] do it for you?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I did a little trial and error (banging head on table) and it looks like MIN with a FILTER would be the way to go. I got round it by adding another column with IF(quantity=0,BLANK(),quantity) then used a MIN on the new column.

    MinStock:=CALCULATE(MIN(Table1[Stock]),FILTER(Table1,Table1[Stock]>0))

    has been suggested on another forum so this will be my way forward.

    Thanks

    E

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply