Showing results for 
Search instead for 
Did you mean: 

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

Regular Visitor

Count number of cases per customer per month based on contract date in customer table


My case should be simple enough for the experts out there. I'm eagher to become one! 🙂

I have 3 tables:
- Cases table with opened_at, Customer name, case number
- Customer Info table with Customer name, start date, Last Cycle Date and other date columns

- Calendar table

I have relationships between:

- Case table and Calendar table (Calendar.Date --> Case.opened_at)

- Case table and Customer table ( Customer Info.Customer <--> Case.CustomerName)


I need to create a visual that returns the count of cases a customer opened after Last Cycle Date that is stored in the Customer Info table.

The best I achieved was to create a measure that returns correct number of cases after Last Cycle Date (which is 23/03/2023) but also returns a weird count prior to Last Cycle Date.

#OrdersPerStartDate =
        ALL('customer info'),
         'customer info'[Last Cycle Date] <= MAX('Calendar'[Date]) &&
         'customer info'[Customer] = SELECTEDVALUE('customer info'[Customer])


What I expect is to have results only for last 3 rows in this customers example since the Last Cycle Date is 23/03/2023.
Your help is much appreciated 



Community Support
Community Support

Hi @HugoC ,


I can't tell the difference between the correct value and the wrong value just by looking at the picture. What do they look like in the original data?

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.


Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly


Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

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

Power BI Fabric Summit Carousel

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