Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi
I am looking for a solution to count the number of days since the last update date. I have a slicer for years (2020, 2021, 2022, etc.), and when I select the year , I need to calculate the number of days from the last date of the selected year to the last update by Team.
See the sample
Solved! Go to Solution.
Hi @ajisharavind_99,
Let's assume you have such a calendar table not connected to the main one:
Having that table, you could create such a measure:
In plain text for convenience:
Diff Measure =
VAR LastUpdate = MIN ( [Last Update] )
VAR MaxDate = MAX ( 'Date'[Date] )
RETURN DATEDIFF ( LastUpdate, MaxDate, DAY )
Best Regards,
Alexander
Hi @ajisharavind_99 ,
There is an another solution for you, different with @barritown , need not create a large date table.
1. below is my test table
Table:
Year:
2. create ameasure with below dax formula
Measure =
VAR _year =
SELECTEDVALUE ( 'Year'[Year] )
VAR _date =
DATE ( _year, 12, 31 )
VAR lu =
SELECTEDVALUE ( 'Table'[Last Update] )
RETURN
IF ( ISFILTERED ( 'Year'[Year] ), ABS ( DATEDIFF ( lu, _date, DAY ) ), "" )
3. add a slicer with Year field, add a table visual with Table fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ajisharavind_99,
Let's assume you have such a calendar table not connected to the main one:
Having that table, you could create such a measure:
In plain text for convenience:
Diff Measure =
VAR LastUpdate = MIN ( [Last Update] )
VAR MaxDate = MAX ( 'Date'[Date] )
RETURN DATEDIFF ( LastUpdate, MaxDate, DAY )
Best Regards,
Alexander
@barritown @Anonymous I appreciate your prompt reply. You made my day, and both were successful.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |