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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
RichOB
Post Patron
Post Patron

Need help with Count measure per month

Hi, I'm looking to get the count of total dogs who were actively in a kennel each month in 2024. Using the table, what measure would give me the figures below, please? Where to connect the dates is giving me the most problems. I have made a calendarauto calendar, but I can't connect the Calendarauto[date] to the Table[Start_Date] AND Table[End_Date] as it gives me an ambiguous path error. How do I do this, please? Any help is greatly appreciated.

 

January 9

February 9

March 8

April 8 

May 7

June 7

July 5

August 5

September 3

October 3

November 3

December 3

 

DogStart_DateEnd_DateSupport_Status
Max01/01/202420/05/2024Closed
Molly01/01/2024 Open
Alba01/01/202420/07/2024Closed
Chester01/01/202420/08/2024Closed
Birdie01/01/2024 Open
Alf01/01/202420/06/2024Closed
Biffy01/01/2024 Open
Bob01/01/202420/02/2024Closed
Tess01/01/202420/04/2024Closed

 

Thanks

3 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@RichOB You already have a Calendarauto table, but ensure it covers the year 2024.

Calendar = CALENDAR(DATE(2024, 1, 1), DATE(2024, 12, 31))

 

You cannot directly connect both Start_Date and End_Date to the Calendar table due to the ambiguous path error. Instead, you can use measures to calculate the active dogs.

 

Create Measures: Use DAX to create measures that count the number of active dogs for each month.

ActiveDogs =
VAR CurrentMonthStart = MIN(Calendar[Date])
VAR CurrentMonthEnd = MAX(Calendar[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_Date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_Date]), Table[End_Date] >= CurrentMonthStart)
)

 

Use a matrix or table visual to display the count of active dogs by month.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

ryan_mayu
Super User
Super User

@RichOB 

pls see if this is what you want

11.PNG

 

 





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

Proud to be a Super User!




View solution in original post

HarishKM
Solution Sage
Solution Sage

@RichOB Hey,
First create a caleder table using New Table -> use dax

Calender =
 
ADDCOLUMNS(CALENDAR(DATE(2010,01,01),DATE(2050,12,01)),
"Year",YEAR([Date]),
"Month-Year",FORMAT([Date],"MMM-YY"))

Then try to create 1 active relationship and 1 inactive relationship with your both date column.

You can drag calender month year in table visual.
create a below measure - 
# of Dog = COUNTROWS('Table name')


HarishKM_0-1744106067754.png
Hopefully this will solve your issue.

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

View solution in original post

6 REPLIES 6
v-shamiliv
Community Support
Community Support

Hi @RichOB 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-shamiliv
Community Support
Community Support

Hi @RichOB 
I wanted to check if you had the opportunity to review the information provided by @HarishKM , @bhanu_gautam and @ryan_mayu . Please feel free to contact us if you have any further questions. If their response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

HarishKM
Solution Sage
Solution Sage

@RichOB Hey,
First create a caleder table using New Table -> use dax

Calender =
 
ADDCOLUMNS(CALENDAR(DATE(2010,01,01),DATE(2050,12,01)),
"Year",YEAR([Date]),
"Month-Year",FORMAT([Date],"MMM-YY"))

Then try to create 1 active relationship and 1 inactive relationship with your both date column.

You can drag calender month year in table visual.
create a below measure - 
# of Dog = COUNTROWS('Table name')


HarishKM_0-1744106067754.png
Hopefully this will solve your issue.

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

v-shamiliv
Community Support
Community Support

Hi @RichOB 
Thank you for reaching out microsoft fabric community forum.

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

ryan_mayu
Super User
Super User

@RichOB 

pls see if this is what you want

11.PNG

 

 





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

Proud to be a Super User!




bhanu_gautam
Super User
Super User

@RichOB You already have a Calendarauto table, but ensure it covers the year 2024.

Calendar = CALENDAR(DATE(2024, 1, 1), DATE(2024, 12, 31))

 

You cannot directly connect both Start_Date and End_Date to the Calendar table due to the ambiguous path error. Instead, you can use measures to calculate the active dogs.

 

Create Measures: Use DAX to create measures that count the number of active dogs for each month.

ActiveDogs =
VAR CurrentMonthStart = MIN(Calendar[Date])
VAR CurrentMonthEnd = MAX(Calendar[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_Date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_Date]), Table[End_Date] >= CurrentMonthStart)
)

 

Use a matrix or table visual to display the count of active dogs by month.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
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.