Forum Discussion

MRozeboom's avatar
MRozeboom
Microsoft Employee
4 years ago
Solved

Calculate count based on date column while adding 365 days

Hi all,

 

I'm trying to build a report that includes a card showing a count of expired dates. The report is based on a SharePoint list where the actual expiration date is a calculated value, making it seen as text in PowerBI. Formatting it to Date switches several days/months around, so that's not a viable option, unfortunately.

What I'm trying to do instead of that is make the calculation based on the initial date the expiration value is counted from. This is a date 365 days prior to the expiration date, so I have to add those 365 days back. 

Based on searches, I came to the following measure string:

 
Measure = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table', 'Table'[Initial date]<=TODAY()+365))
 
However, this still shows me all records.
 
Can anyone help me with how I can calculate the amount of records that expired before today based on the ID, as this is a unique value, filtered before the data in the "Initial date" column + 365 days?
 
Thank you very much in advance.
 
Cheers,
 
Mike Rozeboom
  • MRozeboom , Try like. based on what I got

    Measure = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table', 'Table'[Initial date]+365 <=TODAY()))

2 Replies

  • MRozeboom , Try like. based on what I got

    Measure = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table', 'Table'[Initial date]+365 <=TODAY()))

    • MRozeboom's avatar
      MRozeboom
      Microsoft Employee

      That is perfect mate. Worked like a charm. Thank you very much!