Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
evan_hoefling
Frequent Visitor

Trying to determine number of clients with inactive cases

Hey all, I am new to power bi and am trying to determine which of my clients do not have an active cases. My data is structured as follows: (EXAMPLE)

case table

case_id active_case

1

 Yes
2 No
3

 Yes

 

client table (this is where I am trying to create the column)

client_id active_cases
1 ???
2 ???
3 ???

 

cases_to_client

case_id client_id
1

 1

1 3
2 2
3 1
3 3

 

ideally the client table would look like this in the end:

client_id only_active_cases
1 Yes
2 No
3 Yes

 

I am trying to display a count for only active cases.

1 ACCEPTED SOLUTION
jeroendekk
Resolver V
Resolver V

Hi @evan_hoefling 

First i would merge the case table and the cases_to_client table to get the active state on the cases_to_client table. This makes it simpler.

You could then add a column with this function.

Only active cases = 
VAR CountofNo =
    COUNTROWS (
        FILTER (
            RELATEDTABLE ( cases_to_client ),
            cases_to_client[ active_case] = "No"
        )
    )
RETURN
    IF ( CountofNo > 0, "No", "Yes" )

 
However if you just want a count of inactive / or active cases, it is better to not do a calculated column and solve it with measures.

Count of active = 
CALCULATE (
    COUNTROWS ( cases_to_client ),
    cases_to_client[ active_case] = "Yes"
) + 0


Count of inactive = 
CALCULATE (
    COUNTROWS ( cases_to_client ),
    cases_to_client[ active_case] = "No"
) + 0

 
I hope this helps
If my awnser helped you please not this as resolved and kudos are welcome.

Jeroen Dekker


View solution in original post

1 REPLY 1
jeroendekk
Resolver V
Resolver V

Hi @evan_hoefling 

First i would merge the case table and the cases_to_client table to get the active state on the cases_to_client table. This makes it simpler.

You could then add a column with this function.

Only active cases = 
VAR CountofNo =
    COUNTROWS (
        FILTER (
            RELATEDTABLE ( cases_to_client ),
            cases_to_client[ active_case] = "No"
        )
    )
RETURN
    IF ( CountofNo > 0, "No", "Yes" )

 
However if you just want a count of inactive / or active cases, it is better to not do a calculated column and solve it with measures.

Count of active = 
CALCULATE (
    COUNTROWS ( cases_to_client ),
    cases_to_client[ active_case] = "Yes"
) + 0


Count of inactive = 
CALCULATE (
    COUNTROWS ( cases_to_client ),
    cases_to_client[ active_case] = "No"
) + 0

 
I hope this helps
If my awnser helped you please not this as resolved and kudos are welcome.

Jeroen Dekker


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.