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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MostafaGamal
Helper V
Helper V

how to count the number of row based on date value

Hi All, 

if i have the following table like this 

 

Capture.PNG

how the calculate the number of "defect " that found more than 30 days ago, please help 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@MostafaGamal ,

You have try a measure like

calculate(countrows(table), filter(table,Table[Date]<=today()-30))
calculate(countrows(table), filter(all(table),Table[Date]<=today()-30))

calculate(countrows(table), filter(all(table),Table[Date]<=<=selectedvalue(Date[Date])-30))

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@MostafaGamal ,

You have try a measure like

calculate(countrows(table), filter(table,Table[Date]<=today()-30))
calculate(countrows(table), filter(all(table),Table[Date]<=today()-30))

calculate(countrows(table), filter(all(table),Table[Date]<=<=selectedvalue(Date[Date])-30))

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
Pragati11
Super User
Super User

Hi @MostafaGamal ,

 

Few questions:

  1. Do you want to count Number of Defects against a Department?
  2. What do you mean by - number of "defect " that found more than 30 days ago? Is it 30 days ago from today's date?

Try posting a sample input with expected output. This will help in understanding the issue clearly.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 

I mean the date the defect was found, i want to know the no. of defects that has been on the system for more than 30 days 

not the defects that found in last 30 days, i expect a table with no. of defects againts department but they must be found in the system for more than 30 days 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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