Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Conditional column based on a subset of column value

Hi Experts,    I cannot fully get row/query context when doing a calculation. I have got some data to illustrate and hoping to get some help, below is my data. I want created a conditional column t...
  • az38's avatar
    az38
    6 years ago

    Anonymous 

    replace "Undefined" to "F"

    Conditional Column = 
    var _orderF = calculate(countrows('Table'),allexcept('Table','Table'[Transaction ID]),'Table'[Order type]="F")
    var _orderC = calculate(countrows('Table'),allexcept('Table','Table'[Transaction ID]),'Table'[Order type]="C")
    return
    if(_orderF > 0, "F", IF(_orderC > 0, "C", "F"))

     

    do not hesitate to give a kudo to useful posts and mark solutions as solution