Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

countrows if fact table contains specific value

Hello need refresher in coming up with this simple countrow measure.    Table 1     Table 2   Site ID     Site ID Category A     A Building B     A Passive C     B...
  • AlB's avatar
    4 years ago

    Hi Anonymous 

    Try this measure

    Measure_ =
    VAR auxT_ =
        CALCULATETABLE ( DISTINCT ( Table2[SiteID] ), Table2[Category] = "Passive" )
    RETURN
        COUNTROWS (
            FILTER ( auxT_, CALCULATE ( DISTINCTCOUNT ( Table2[Category] ) ) = 1 )
        )

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.