Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Measure to compare columns

Hello,   first of all to understand: I have a dataset, where I can see which employee booked how many hours on which confirmation and on which date. I can see if they are approved hours or not. Us...
  • Floriankx's avatar
    Floriankx
    8 years ago

     

    Hello,

     

    This wouldn't be a smooth solution.

     

    quentin_vigne: Index is a great idea, but in this case, the two rows would get different index numbers which wasn't my intention.

     

    Maybe you could try the following:

    Create a calculated column:

     

    Appearnces=
    VAR Employee=[Employee]
    VAR Date=[Work Date]
    VAR ConfID=[Confirmation number]
    ....
    RETURN
    COUNTROWS(FILTER(TableName,[Employee]=Employee&&[Work Date]=Date&&[Confirmation number]=ConfID))

    This measure should give you the number of appearances. Should be either 1 or 2.

     

    Then you can create a reverse filter:

    TotalNoDouble=CALCULATE(
    SUM([Booked Hours],
    FILTER(Table,NOT([Appearances]=2&&[Approval status]="not approved")))

    Give it a try and let us know.

     

    Best regards