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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
James_Galis1
Helper II
Helper II

Count events on dates based on condition

Hello Community

Hoping to get some assistance with the following.

 

I have a table of contents that has clients attending an event over various dates.
I want to count the events but only when there has been more than 4 clients attend over any given date .
Eg

 

Visit Start DateClient ID
10/04/2024AC000001559
10/04/2024AC000072718
10/04/2024AC000637102
10/04/2024AC000876443
10/04/2024AC000949724
10/04/2024AC001095530
10/04/2024AC001118236
10/04/2024AC002313429
10/04/2024AC003762526
10/04/2024AC004373399
10/04/2024AC005013076
12/04/2024AC002313429
16/04/2024AC000001559
16/04/2024AC000857537
16/04/2024AC001032870
16/04/2024AC001070439
16/04/2024AC001118236
16/04/2024AC001743949
16/04/2024AC002564643
16/04/2024AC004049946
16/04/2024AC004228120
16/04/2024AC004269964
16/04/2024AC004373399
16/04/2024AC005013076

 

From the above , there are 3 dates. Only the 10th and 16th have a count of more than 4 clients.

The outcome im wishing to acheive is to have a measure to calculate the number of events and from the above the results should be 2.

Many Thanks

2 ACCEPTED SOLUTIONS
Ahmedx
Super User
Super User

DataNinja777
Super User
Super User

Hi @James_Galis1 

You can produce your required output in many different ways and one of them is to create a separate calendar table from the min and max of your date field in your fact table, and then create a relationship with your calendar table and the fact table, and then write a dax formula like below to produce a visual like below.

 

DataNinja777_0-1716608024392.png

I attach an example pbix file.  

View solution in original post

3 REPLIES 3
DataNinja777
Super User
Super User

Hi @James_Galis1 

You can produce your required output in many different ways and one of them is to create a separate calendar table from the min and max of your date field in your fact table, and then create a relationship with your calendar table and the fact table, and then write a dax formula like below to produce a visual like below.

 

DataNinja777_0-1716608024392.png

I attach an example pbix file.  

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Thank You 

This works best for how i wish to present the data

Many thanks

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.