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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply

Refinement of CALCULATE measures with USERELATIONSHIP, to include FILTER & DISTINCTCOUNT

Hi folks, I'm hoping someone can help. I have the below measure that I'm using the count total incidents using an inactive relationship:

 

INACTIVE_Count of Incidents created = CALCULATE ( COUNTA ('incidents'[Created By - Name] ), USERELATIONSHIP ('users'[Name], 'incidents'[Created By - Name] ) )

 

I'd like to re-use this measure with it's CALCULATE wraparound to create two new measures, with the below changes:

 

For the first measure:

 

  • Instead of a COUNTA of 'incidents'[Created By - Name], it should be a DISTINCTCOUNT of 'deflections'[Viewed]
  • I need to filter out results from a 'deflections'[user] column so that it only includes "string1" strings

For the second measure:

  • Instead of a COUNTA of 'incidents'[Created By - Name], it should be a DISTINCTCOUNT of 'deflections'[Viewed]
  • I need to filter out results from a 'deflections'[user] column so that it doesn't include "string2" or "string3" strings

I'm having trouble figuring out how to use FILTERs and DISTINCTCOUNTs in an inactive relationship, so any help would really be appreciated 🙂

1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

@MichaelHutchens You could try this approach:

 

Measure1 =
CALCULATE (
DISTINCTCOUNT ( 'deflections'[Viewed] ),
USERELATIONSHIP ( 'users'[Name], 'incidents'[Created By - Name] ),
'deflections'[user] = "string1"
)

 

Measure2 =
CALCULATE (
DISTINCTCOUNT ( 'deflections'[Viewed] ),
USERELATIONSHIP ( 'users'[Name], 'incidents'[Created By - Name] ),
NOT ( 'deflections'[user] IN { "string2", "string3" } )
)

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

1 REPLY 1
DataZoe
Microsoft Employee
Microsoft Employee

@MichaelHutchens You could try this approach:

 

Measure1 =
CALCULATE (
DISTINCTCOUNT ( 'deflections'[Viewed] ),
USERELATIONSHIP ( 'users'[Name], 'incidents'[Created By - Name] ),
'deflections'[user] = "string1"
)

 

Measure2 =
CALCULATE (
DISTINCTCOUNT ( 'deflections'[Viewed] ),
USERELATIONSHIP ( 'users'[Name], 'incidents'[Created By - Name] ),
NOT ( 'deflections'[user] IN { "string2", "string3" } )
)

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.