Forum Discussion

mahsan_ojaghian's avatar
4 years ago
Solved

create a measure that converts negative values to zero

Hi Guys.

I'm really Confused!!!

I have a table like this:

ITEM_CODENEEDINVENTORY_QTYMISS_0
ITM_11005050
ITM_220010190
ITM_335100

-65

I want to create a measure that converts negative values to zero.

I need to sum of [MISS_0] column in a cart and it should show 240 not 175.

and I need to use measure and not calculate column because I have other filters that using of calculate column does'nt helpful.

Now my solution is using filter on this visual(Table) that filters Positive values but this way can't help me cause we cant filter measure with single value in a Cart.

I need a measure just sum positives or in the best way converts to zero.

Thanks.

  • Hi  mahsan_ojaghian ,

     

    Try the following measure:

    Only Positive = SUMX( FILTER(Table, Table[Miss_0] > 0), Table[Miss_0])

1 Reply

  • Hi  mahsan_ojaghian ,

     

    Try the following measure:

    Only Positive = SUMX( FILTER(Table, Table[Miss_0] > 0), Table[Miss_0])