Forum Discussion

learner03's avatar
learner03
Post Partisan
4 years ago
Solved

If condition issue

How can write a DAX for below to get desired result in Result whole order fulfil column- So, if for an order no., 'can fulfil' column is same for all items, then 1 otherwise 0 if even one item in th...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    I am not sure if I understood correctly your question, because I am confused about order number E and F.

    However, please check the below picture and the attached pbix file. It shows the same result as yours.

     

    Result whole order fulfil CC = 
    VAR currentorderno = Data[order no.]
    VAR filtertable =
        FILTER ( Data, Data[order no.] = currentorderno && Data[can fulfil] <> 1 )
    RETURN
        IF ( COUNTROWS ( filtertable ) > 0, 0, 1 )
  • Samarth_18's avatar
    4 years ago

    Hi learner03 ,

     

    You can also try this:-

    Result whole order fufil = 
    var result = COUNTROWS(FILTER('Table','Table'[order no.] = EARLIER('Table'[order no.]) && 'Table'[can fulfil] = 0))
    return IF(ISBLANK(result),1,0)

    output:-

     

     

    Thanks,

    Samarth