Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi All,
I want to find the gap between dates for each group. Sample data can be found here.
How will be able to do it.
Thank You,
Solved! Go to Solution.
Hi,
This is the calculated column formula i wrote. You may download my solution file from here.
=if(ISBLANK(CALCULATE(MAX(Data[Session Date]),FILTER(Data,Data[GroupId]=EARLIER(Data[GroupId])&&Data[Session Date]<EARLIER(Data[Session Date])))),BLANK(),Data[Session Date]-CALCULATE(MAX(Data[Session Date]),FILTER(Data,Data[GroupId]=EARLIER(Data[GroupId])&&Data[Session Date]<EARLIER(Data[Session Date]))))
Hope this helps.
Hi,
Show the result in a simple Table.
@Ashish_Mathur, Do you mean the required result? If yes, its already in the sample data set. Remember this is just for three groups. Actual data size is much bigger.
Hi,
This is the calculated column formula i wrote. You may download my solution file from here.
=if(ISBLANK(CALCULATE(MAX(Data[Session Date]),FILTER(Data,Data[GroupId]=EARLIER(Data[GroupId])&&Data[Session Date]<EARLIER(Data[Session Date])))),BLANK(),Data[Session Date]-CALCULATE(MAX(Data[Session Date]),FILTER(Data,Data[GroupId]=EARLIER(Data[GroupId])&&Data[Session Date]<EARLIER(Data[Session Date]))))
Hope this helps.
Tried this way,
Rank =
VAR d=Table1[Session Date].[Date]
VAR c=Table1[GroupId]
RETURN
CALCULATE(RANK.EQ(d,Table1[Session Date].[Date],ASC),FILTER(ALL(Table1),Table1[GroupId]=c))
2. Create a new column named DateDiff,
DateDiff =
VAR d=Table1[Session Date].[Date]
VAR r=Table1[Rank]
VAR g=Table1[GroupId]
RETURN
CALCULATE(DATEDIFF(LOOKUPVALUE(Table1[Session Date],Table1[GroupId],g,Table1[Rank],r-1),d,DAY))
Hi @Kumar11109,
Do you wish to calculate days between Latest and Earliest Session Date for each group?
No I want to calculate difference between each date for each group.
User | Count |
---|---|
98 | |
66 | |
57 | |
47 | |
46 |