Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I have a dataset that currently looks like this:
The dataset contains multiple entries for each company. For each company, I'm trying to create a measure to return how long it has been since it was entered into the dataset. I know I need to use DateDiff but having trouble creating the var for initial date and current date.
For example, the company Jaya Grocer entered the dataset on 10/12/2019, so the measure would return 58 days.
Any ideas how I can achieve this?
Solved! Go to Solution.
@rjsidek Please try below measure to get the date diff
Measure =
VAR _startdate = CALCULATE(MIN('Table'[Date]),ALLEXCEPT('Table','Table'[Company]))
RETURN DATEDIFF(_startdate,TODAY(),DAY)If it help accept post as solution.
If you want that a new column and use that to take date diff
MINX(filter('Table','Table'[Company]=earlier('Table'[Company]) && 'Table'[Event Date]<earlier('Table'[Event Date])),'Table'[Event Date])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Is there a way to do it without a new column?
@rjsidek Please try below measure to get the date diff
Measure =
VAR _startdate = CALCULATE(MIN('Table'[Date]),ALLEXCEPT('Table','Table'[Company]))
RETURN DATEDIFF(_startdate,TODAY(),DAY)If it help accept post as solution.
Hi Vimal,
Thanks for the reply. I have created the measure, but it is not retuning the correct date. Plus, when I toggle different company names using a slicer, the visualization just stays the same and does ot change from company to company. Is there a way to correct the DAX?
The measure seems correct. Check date format and take a look at Change how visuals interact in a report.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.