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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Previous Month Function- DAX

Hi,

I have a dataset with names and the hiring dates. I also have a calendar table. I am trying to simply find the number of people who joined last month by using the previous month function. However, the previous month funtion is not returning any value. Please help to solve this. Thanks!

 

cc.PNG

 

cc.PNG

 

cc.PNG

Previous month head count = CALCULATE(COUNT(Sheet1[Name]),PREVIOUSMONTH('Sheet1 (2)'[CalendarDate]))
3 REPLIES 3
Anonymous
Not applicable

First, your tables are BADLY NAMED. Good naming is of paramount importance in any programming activity.

Secord, your formula doesn't work because you should always check what arguments a function takes.

Please see: www.daxguide.com/count

Best
D.
Anonymous
Not applicable

This is dummy data. The count function works fine when I calculate the total head count.

Anonymous
Not applicable

PREVIOUSMONTH -> Returns a table that contains a column of all dates from the previous month, based on the first date in the dates column, in the current context.

This might be the cause of your problem. The above function works OK when used on a day or a month level. Anything of lower granularity and you've got a problem.

Best
D.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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