cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
STS_Joshua Regular Visitor
Regular Visitor

Calculating dynamic count of linked objects

Hi all,

 

Hopefully I can get a little help with a count measure.

I have two identical tables of Items and customers who bought them (sample):

ItemCustomer
Item 1Bob
Item 2Susy
Item 3Mary
Item 4Joe
Item 5Joe
Item 6Joe

 

These tables are linked by customer name so that if you  have them side by side and selected Item 5 from table one it would then show Items 4, 5, and 6 from table two. 

 

I'm looking to create a measure that will count the items on table two that are returned excluding the identical item from table 1.  So something like this:

 

ItemCustomer Item CustomerMeasure 1
Item 1Bob Item 4Joe1
Item 2Susy Item 5Joe 
Item 3Mary Item 6Joe1
Item 4Joe    
Item 5Joe    
Item 6Joe    

 

Hopefully there is a way to do this.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calculating dynamic count of linked objects

Hi @STS_Joshua 

Try the following measures

Measure = CALCULATE(COUNT(Table2[Item]),EXCEPT(Table2,Table1))

Measure 2 = CALCULATE(COUNT(Table2[Item]),ALL(Table2))

Measure 3 = [Measure]/[Measure 2]

11.png

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
STS_Joshua Regular Visitor
Regular Visitor

Re: Calculating dynamic count of linked objects

Well I figured that out through some trial and error.

Measure1 = CALCULATE(COUNT('Table2'[Item]), EXCEPT('Table2', 'Table1'))

 

Now I'm having an issue with determining that item's % of that value. In the above example I'd like another measure to show Item 4 and 5 as 50% of the total count of filtered items.

STS_Joshua Regular Visitor
Regular Visitor

Re: Calculating dynamic count of linked objects

Like this:

Capture.PNG

Community Support Team
Community Support Team

Re: Calculating dynamic count of linked objects

Hi @STS_Joshua 

Try the following measures

Measure = CALCULATE(COUNT(Table2[Item]),EXCEPT(Table2,Table1))

Measure 2 = CALCULATE(COUNT(Table2[Item]),ALL(Table2))

Measure 3 = [Measure]/[Measure 2]

11.png

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team
Community Support Team

Re: Calculating dynamic count of linked objects

Hi @STS_Joshua 

Is this problem sloved?

If not, please let me know.

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.