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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Kolumam
Post Prodigy
Post Prodigy

Counting the values at the end of each quarter

Hi All,

 

I am trying to count the number of values at the end of each quarter. If you see my below result for number of Cleanings, it should be 9 for Qtrr 1 2019 and 5 for Qtr 4 2018 but it counts the total and puts 14 in Qtr1 2019. How do I fix this?

IS my formula correct?

Number of Cleanings = CALCULATE(DISTINCTCOUNT('Cleaning Activity'[Id]),FILTER('Cleaning Activity','Cleaning Activity'[Date of Cleaning]<=ENDOFQUARTER('Month'[Month])))

Quarter is a calculated column from Months table.quarter.JPG

 

 

 

 

 

 

 

 

The expected result is the below:

fsdf.JPG

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

It looks like your 'Cleaning Activity' table has some issues with the relationship to the 'Month' table. Try applying a 'Cleaning Activity'[Date of Cleaning]>=STARTOFQUARTER(Month[Month]) filter to the measure aswell. 

Number of Cleanings = 
CALCULATE(DISTINCTCOUNT('Cleaning Activity'[Id]),
FILTER(
'Cleaning Activity',
'Cleaning Activity'[Date of Cleaning]<=ENDOFQUARTER('Month'[Month]) && 'Cleaning Activity'[Date of Cleaning]>=STARTOFQUARTER('Month'[Month]) ))

 

 


Connect on LinkedIn

View solution in original post

1 REPLY 1
tex628
Community Champion
Community Champion

It looks like your 'Cleaning Activity' table has some issues with the relationship to the 'Month' table. Try applying a 'Cleaning Activity'[Date of Cleaning]>=STARTOFQUARTER(Month[Month]) filter to the measure aswell. 

Number of Cleanings = 
CALCULATE(DISTINCTCOUNT('Cleaning Activity'[Id]),
FILTER(
'Cleaning Activity',
'Cleaning Activity'[Date of Cleaning]<=ENDOFQUARTER('Month'[Month]) && 'Cleaning Activity'[Date of Cleaning]>=STARTOFQUARTER('Month'[Month]) ))

 

 


Connect on LinkedIn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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