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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Filter Context for Distinct Counts

Hello,

 

I have a data model that includes a User table, which includes an individual name and the team in which they belong to, that is joined to a transactional table (Owner History) by User Name. Together, they are used to show the total case load being managed across teams. The Owner History table offers a record/row every time there is an ownership change within a case. I want to build a measure that reflects the total number of unique cases that are owned both at the individual level and the team level. Here’s an example:

 

User Table

UserName          Team

Person1              A

Person2              B

Person3              C

Person4              A

 

Owner History

UserName                        Case#                  Date

Person1                             123                      12/1/17

Person2                            123                      12/2/17

Person1                            123                      12/3/17

Person3                            456                      1/4/18

Person4                            456                      1/4/18

Person1                            456                      1/5/18

Person2                            456                      1/6/18

Person4                            456                      1/6/18

Person4                            789                      1/3/18

Person2                            789                      1/4/18

 

 

What I would like to produce:

 

Measure 1  (Distinct count of the total number of cases owned by an individual)

Person1 = 2

Person2 = 3

Person3 = 1

Person4 = 2

 

Measure 2 (Distinct count of the total number of cases owned by a team)

Team A = 3

Team B = 3

Team C = 1

 

I’ve been able to produce Measure 1 okay, but I can’t seem to get the correct filter context for Measure 2; what I get produces an additive result, so from this example it results in Team A having 4 cases, but in reality, it should only be 3, as both Person1 and Person4 owned case# 456.  

 

Appreciate any help that is offered.

 

Thank you,

1 ACCEPTED SOLUTION
Thejeswar
Resident Rockstar
Resident Rockstar

Hi,

Even the simple count distinct of the column case# would solve your need.

 

Not getting why you need a separate DAX. can you clarify my understanding ?

 

The Screenshot for the same is below.

Capture.PNG

 

 

 

View solution in original post

3 REPLIES 3
Thejeswar
Resident Rockstar
Resident Rockstar

Hi,

Even the simple count distinct of the column case# would solve your need.

 

Not getting why you need a separate DAX. can you clarify my understanding ?

 

The Screenshot for the same is below.

Capture.PNG

 

 

 

Anonymous
Not applicable

Thank you, yes there was an error in my part based on my interpretation of the results. Appreciate the help.

Seward12533
Solution Sage
Solution Sage

Try one of these
1) use person or team from lookup table in visual
2) turn on cross filter direction to both for the relationship
3) force crosfikter in Dax.

See this example. https://1drv.ms/u/s!AuCIkLeqFmlhhJgzLZ6jPcWgLGu3Yw

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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