Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Counting with filter including related table

I have the following that works fine:

WO Status = countrows(Filter('D_Task',D_Task[Work Order Age]>90 && D_Task[Work Order Type]="Alert" && D_Task[Task Substate]="Acknowledged"))

 

Now I need to add a filter to this formula from a related table/column but can't get it to work (tried using RELATED):

Table: D_Device

Column: Model

Filtering on = "New"

 

Appreciate any help,

Z

  • Anonymous,

     

    The RELATED function requires that a relationship exists between the current table and the table with related information.

    WO Status =
    COUNTROWS (
        FILTER (
            'D_Task',
            D_Task[Work Order Age] > 90
                && D_Task[Work Order Type] = "Alert"
                && D_Task[Task Substate] = "Acknowledged"
                && RELATED ( D_Device[Model] ) = "New"
        )
    )
    

1 Reply

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    Anonymous,

     

    The RELATED function requires that a relationship exists between the current table and the table with related information.

    WO Status =
    COUNTROWS (
        FILTER (
            'D_Task',
            D_Task[Work Order Age] > 90
                && D_Task[Work Order Type] = "Alert"
                && D_Task[Task Substate] = "Acknowledged"
                && RELATED ( D_Device[Model] ) = "New"
        )
    )