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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ajay_gajree
Helper I
Helper I

Power BI Desktop: DAX expression to calculate the no. of rows in my Table for Last Month

No. of Breaches Last Month = CALCULATE(
                                COUNTROWS(Breaches),
                                PREVIOUSMONTH('Fiscal Calendar'[Date])
                                )

Hi All

 

I am trying to calculate the number of rows in my table for last month only using a measure.

 

My DAX above is returning Blank, when there is a number

 

Any obvious error? 

 

Thx in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @ajay_gajree ,

You can try to use date function to manually defined date range filter instead to use time intelligence functions.

Time Intelligence "The Hard Way" (TITHW)

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @ajay_gajree ,

You can try to use date function to manually defined date range filter instead to use time intelligence functions.

Time Intelligence "The Hard Way" (TITHW)

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

@ajay_gajree  - PREVIOUSMONTH needs to have an input (filter context). If you put your calculation into a table with months, No. of Breaches in Month (straight COUNTROWS calculation) and No. of Breaches Last Month, you will be able to compare the values. 

If you want to see the value in a card, you will need to filter/slice the page to the current month.

Hope this helps,

Nathan

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors