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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
HarperCash
Regular Visitor

Count number of rows with a date older than six months from current date

Hi,

 

I'm trying to achieve 2 things.

The first is to create a measure that I can use with a card to show acount of how many items have "expired" by check if a date in the Last Updated column is six months older or more than today's date (dynamincally).

 

The second, is to display the same data within a table and have all dates that are more than six months old highlighted red.

 

I can do both thins in excel but am really struggling with how to do it in Power Bi.

 

Thanks!

1 ACCEPTED SOLUTION
HarperCash
Regular Visitor

Figure it out, used the below:

 

Expired = CALCULATE(COUNT('Sheet1 (2)'[Custom]),'Sheet1 (2)'[Last Updated:]<=EOMONTH(TODAY(),-6))

View solution in original post

3 REPLIES 3
HarperCash
Regular Visitor

Figure it out, used the below:

 

Expired = CALCULATE(COUNT('Sheet1 (2)'[Custom]),'Sheet1 (2)'[Last Updated:]<=EOMONTH(TODAY(),-6))
selimovd
Super User
Super User

Hey @HarperCash ,

 

maybe tell us how your data looks like and what you tried already?

Just saying "I need a calcualtion that shows the number" doesn't help anyone. We don't know how your data looks like....

 

Best regards

Denis

Sorry about that, example of data below:

InstanceDivisionBrandChatbot NameChannelTypeAutomationStatusLast Updated:Last Published:
UKOccX - HWAWWSMSInfo CaptureNLive23/03/202323/03/2023

Trying to count how many rows are expired by using the Last Updated column but only coutning rows that have a date that is more than six months from the current date.

 

In terms of what I've tried, I tried creating a new column that would provide a value of 1 or 0 based on the below:

if [#"Last Updated:"]([today]) >= 90 then 1 else 0

 

I also tried creating a Measure using the below:

CALCULATE (
    DISTINCTCOUNT Sheet1[Last Updated] <= EOMONTH ( TODAY (), -6 )
)

But neither worked

 

 

 

 

 

 

 

 

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.