cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Post Patron

## DAX Challenge - count occurence of record

Hi guys,

i am struggling with a piece of DAX.

I have 2 tables. [employee] and[access control]. related on empID

I need a measure tht returns how many times an individual occurs in the [accescontrol] table in a given period. returnig 0 if they dont.

eg

employee

 employeeID Name 1 George 2 Lovemore 3 Sydey 4 Montgomery 5 Alecia 6 Nadia 7 Ramu 8 Mark 9 Sean 10 Travor

access control

 EmpID EventDate 3 2021-12-22 1 2022-01-01 5 2022-01-02 6 2022-01-03 8 2022-01-04 9 2022-01-05 10 2022-01-06 10 2022-01-07 5 2022-01-08 3 2022-01-09 1 2022-01-10 1 2022-01-11 6 2022-01-12 4 2022-01-13 9 2022-01-14 10 2022-01-15 9 2022-01-16 5 2022-01-17 2 2022-01-18 2 2022-01-19 9 2022-01-20 8 2022-01-21 6 2022-01-22 6 2022-01-23 5 2022-01-24 4 2022-01-25 3 2022-01-26 3 2022-01-27 4 2022-01-28 2 2022-01-29 1 2022-01-30 1 2022-01-31

filter 1

 2021-12-22 to 2022-01-31 George 5 Lovemore 3 Sydey 4 Montgomery 3 Alecia 4 Nadia 3 Ramu 0 Mark 2 Sean 4 Travor 3

filter 2

 2022-01-01 to 2022-01-10 George 2 Lovemore 0 Sydey 1 Montgomery 0 Alecia 2 Nadia 1 Ramu 0 Mark 1 Sean 1 Travor 2

filter 3

 2022-01-10 to 2022-01-25 George 2 Lovemore 2 Sydey 0 Montgomery 2 Alecia 2 Nadia 3 Ramu 0 Mark 1 Sean 3 Travor 1

hope thats clear enough?

any ideas

thanks a mil

ian

1 ACCEPTED SOLUTION
Super User

Count access: =
IF( HASONEVALUE( Employee[Name] ),
COUNTROWS('Acess Control' ) + 0
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

2 REPLIES 2
Post Patron

100%

thnks so much

Super User

Count access: =
IF( HASONEVALUE( Employee[Name] ),
COUNTROWS('Acess Control' ) + 0
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors