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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Measure - countrows if date is greater than 180 days

Hi Community,

I have a requirement to write a measure to count all items if a date is great than 180 days from today.

SP_SiteOwners[LastActivityOn] is the table and column.

Any help much appreciated, please

Thanks,
CT



1 ACCEPTED SOLUTION
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,
Not sure if I understand, but this counts any date from 180 days ago to today in the table.

 

If date = IF(MAX(SP_SiteOwners[Last Activity On])>TODAY()-180,1,0)
sum = SUMX(SP_SiteOwners,[If date])

 


date if.PNG

 

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,
Not sure if I understand, but this counts any date from 180 days ago to today in the table.

 

If date = IF(MAX(SP_SiteOwners[Last Activity On])>TODAY()-180,1,0)
sum = SUMX(SP_SiteOwners,[If date])

 


date if.PNG

 

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@Anonymous ,

If you put the second measure on the table it works as well.
date if2.PNG

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Anonymous ,
And if you were asking for more than 180 days in the future, change the first measure to:

More than 180 days in the future = SUMX(SP_SiteOwners,IF(MAX(SP_SiteOwners[Last Activity On])>TODAY()+180,1,0))

and point the sum measure to this one.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors