Forum Discussion

Txtcher's avatar
Txtcher
Icon for Helper V rankHelper V
1 year ago
Solved

Most Efficient Way to Count with Filters from Another Table

I have 2 tables:  HCR Intakes  & Allegations. The are related to each other with a 1-many relationship using a field called Intake Id (HCR Intakes have many Allegations). I am trying to obtain a cou...
  • FBergamaschi's avatar
    1 year ago

    Hi,

    I would reduce te measure to only

    Allegation Count NEW =
     CALCULATE(
        COUNTROWS( Allegations ),
        'HCR Intakes'
     )
     

    If this helped, please consider giving kudos and mark as a solution

    me in replies or I'll lose your thread

    consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

  • techies's avatar
    1 year ago

    Hi Txtcher please try this

     

    Allegation =
    CALCULATE(
        COUNTROWS(Allegations),
        TREATAS(VALUES('HCR Intakes'[Intake Id]), Allegations[Intake Id])
    )