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
Jaweed
Helper III
Helper III

Count of occurences

Hi all

Need some help.

 

Table 1  have columns Code, Name

Code Name

01      John   

04      Tom

01      John

03      Robert

04      Tom

04      Tom

 

 

Table 2 ( master table) has columns Code and  Name and the relation is 1 to many on Code with table 1

Code  Name

01      John  

02      Alex   

03      Robert 

04      Tom

05      Jack

 

 

Can you please help me to calculate the occurence  for all names in Table 2 ( the master list)

Code   Name   Occurence

01 John            2

02 Alex            0

03 Robert        1

04  Tom           3

05  Jack            0

        

Thanks. 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
fhill
Resident Rockstar
Resident Rockstar

If your tables are joined together correctly, it should be as easy as dragging the fact (non-master) 'Name' field to a table on the dim (master) Table...  It should 'Count' by default since these are Text Fields, but if not under 'Values' for the fact (non-master) Name, click the small down arrow and choose 'Count'.

 

You'll also want to choose the small down arrow on the Dim (Master) name, and choose 'Show Items with no data'

Hope this helps,

FOrrest

 

 

image.png

 

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




View solution in original post

3 REPLIES 3
fhill
Resident Rockstar
Resident Rockstar

If your tables are joined together correctly, it should be as easy as dragging the fact (non-master) 'Name' field to a table on the dim (master) Table...  It should 'Count' by default since these are Text Fields, but if not under 'Values' for the fact (non-master) Name, click the small down arrow and choose 'Count'.

 

You'll also want to choose the small down arrow on the Dim (Master) name, and choose 'Show Items with no data'

Hope this helps,

FOrrest

 

 

image.png

 

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




hi Forrest

many thanks

 

EricHulshof
Solution Sage
Solution Sage

 

Create the following measure:

 

Occurence = CALCULATE(COUNT(Table1[Code]);Table2[Code])+0

 

 

The +0 is to make sure the people with 0 occurances show up too.


Quality over Quantity


Did I answer your question? Mark my post as a solution!


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.