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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

DAX Measure to show count for previous month

I've created a measure to show the count of accidents that occurred the previous month using the DAX below:

 

Count_Accidents_Previous Month = CALCULATE([Count_Accidents], PREVIOUSMONTH('Date'[Date]))
 
This works find in a table when you have a Month in as a column:
 
1.JPG
 
But I want to be abe to show it on a card (as I can with Year To Date), and currently this doesnt work, just comes up blank:
 
2.JPG
 
Here is the DAX I used for Year to Date:
Count_Accidents_Y2D = CALCULATE([Count_Accidents], YEAR('Date'[Date]))
 
Can't work out why I cant get it to work in a card for Previous Month
2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

Did you have any slicer for date or month?

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@Anonymous , this because you have not filtered or selected a month in the slicer.  In that case, the All-time intelligence function will till the end of time in the date you supplied and calculate the time back. So Looking at the table it giving NOV

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.