Forum Discussion

VikramAdi's avatar
VikramAdi
Icon for Helper II rankHelper II
2 years ago
Solved

Need help to Get latest records from table data by adding flag

Need to get latest record based on each file group on below conditions. PBIX URL : https://drive.google.com/file/d/1YNkpQQKhtOejgPtj48bmS6v6MyadYnfN/view?usp=sharing   1.Sourcesystem="DB"  is late...
  • lbendlin's avatar
    2 years ago

    Flag = 
    var f = [FileName]
    var a = filter(ALL(Data),[FileName]=f)
    return SWITCH(TRUE(),
    [SourceSystem]="DB","yellow",
    [SourceSystem]="APP" && [StepDescription]="import" && countrows(FILTER(a,[SourceSystem]="DB"))=0 && countrows(FILTER(a,[SourceSystem]="APP" && [StepDescription]="import"))=1,"yellow",
    [SourceSystem]="APP" && [StepDescription]="transfer" && countrows(FILTER(a,[SourceSystem]="DB"))=0 && countrows(FILTER(a,[SourceSystem]="APP" && [StepDescription]="import"))=0 && countrows(FILTER(a,[SourceSystem]="APP" && [StepDescription]="transfer"))=1,"yellow"
    )