Inactive (days) = YourDateValue - CALCULATE(MAX([Date]),ALLEXCEPT(TableName,TableName[Name]))
Load to data model. Add DAX measure.
Above is with assumption, that only Name column is used for evaluation context.Code:Inactive (days) = YourDateValue - CALCULATE(MAX([Date]),ALLEXCEPT(TableName,TableName[Name]))
If other filters etc are applied. You'll need to alter DAX to accommodate.
From what point do you need help? Since, you mentioned PowerBI. I assume you are able to load table to data model?
So what's the logic to arrive at "8-May-2019"?
Do you have DAX measure or Parameter that supplies this value?
Inactive (Days) = DATEDIFF(CALCULATE(MAX(Table1[Date]),ALLEXCEPT(Table1,Table1[Name])),[MaxSelectedDate],DAY)
Come to think of it, if doing it in PowerBI and not in Excel data model. DAX should be changed to... (it's also better to use below in Excel as well)
Code:Inactive (Days) = DATEDIFF(CALCULATE(MAX(Table1[Date]),ALLEXCEPT(Table1,Table1[Name])),[MaxSelectedDate],DAY)
See attached sample. However, I assume your actual data is structured differently. I'd recommend uploading sample raw data structure to get more precise help.
Well, 1/1/2019 is "Before" your date field. And the measure is calculating date difference between MAX selected slicer value (12/31/2019) and the date stored in the field.
You'll need to explain to me in detail what your exact requirements are. After all I'm not a mind reader.![]()
The set up already does that. Left slider (start date) has no relevance in calculation. Unless it's greater than Last purchase sale date.