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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
STS_Joshua
Helper II
Helper II

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

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.

View solution in original post

4 REPLIES 4
STS_Joshua
Helper II
Helper II

Like this:

Capture.PNG

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.

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.

STS_Joshua
Helper II
Helper II

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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