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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Count occurrences with date hierarchy

I have a spreadsheet that marks when an organization was contacted. For example 11/12/21, 11/28/21, 1/5/22, 1/6/22, and 1/9/22. How do put in a date hierarchy AND get powerbi to count how many times a month an organization was contacted? I would need the output to be 2 in November 2021 and 3 in January 2022. I have found ways to do one or the other, but not both. 

 

I am new to PowerBI. Any help is appreicated.  

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods. Create a new calendar table.

Table:

Date = CALENDAR(MIN('Table'[contact date]),MAX('Table'[contact date]))

Column:

Month Year = Format([date],"mmm-yyyy")

vzhangti_0-1659344424776.png

Measure:

Count =
CALCULATE (
    COUNT ( 'Table'[contact date] ),
    FILTER ( ALL ( 'Date' ), [Month Year] = SELECTEDVALUE ( 'Date'[Month Year] ) )
)

 

vzhangti_1-1659344570533.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods. Create a new calendar table.

Table:

Date = CALENDAR(MIN('Table'[contact date]),MAX('Table'[contact date]))

Column:

Month Year = Format([date],"mmm-yyyy")

vzhangti_0-1659344424776.png

Measure:

Count =
CALCULATE (
    COUNT ( 'Table'[contact date] ),
    FILTER ( ALL ( 'Date' ), [Month Year] = SELECTEDVALUE ( 'Date'[Month Year] ) )
)

 

vzhangti_1-1659344570533.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

amitchandak
Super User
Super User

@Anonymous , You can create a date table with month, year, qtr etc., and join it with the date of your table and if needed you can create a custom hierarchy.

 

or you can use the filter from the date table

 

Addcolumns(calendar(date(2020,01,01), date(2021,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors