Forum Discussion

RubenMerino's avatar
RubenMerino
Frequent Visitor
2 years ago
Solved

Problem with compare date column between two row

Hi   I make column that evalute if row has a date less than other row according this conditional:   If value in "Data Reporting" of row with "FIV" in column "Tipus de planificació" and 1 in colu...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi RubenMerino ,

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create a calculated column.

    Column = 
    var _a=CALCULATE(MAX('Table'[Data Reporting]),FILTER('Table','Table'[NHC]=EARLIER('Table'[NHC]) && 'Table'[Count_FIV_per_NHC]=1 && 'Table'[Tipus de planificació]="FIV"))
    var _b=CALCULATE(MAX('Table'[Data Reporting]),FILTER('Table','Table'[NHC]=EARLIER('Table'[NHC]) && 'Table'[Count_NFUR_per_NHC]=1 && 'Table'[Tipus de planificació]="NFUR"))
    return IF('Table'[Count_FIV_per_NHC]=1 && 'Table'[Tipus de planificació]="FIV",IF(_a<=_b,1,0))

    (3) Then the result is as follows.

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.