March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi There,
I am trying to find the number of days between a same product being applied on a same field on the basis of application dates. Whenever a product is applied on the field, the date is recorded as Application Date.
The report looks like:
and the measure I am using to calculate is:
But this gives me the no. of days between the first and last application dates. What I am looking for is to caclculate no. of days between previous and next application dates.
As per the 1st and 2nd record in the report, No. of days should be 7 days (Previous date :17th June 2021 and Next date: 24 June 2021.
How to achieve this?
Appreciate your help.
Solved! Go to Solution.
Hi @Anonymous ,
Not sure is this is what you need but you can try creating this measure :
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
Hi @Anonymous ,
Not sure is this is what you need but you can try creating this measure :
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
It works as expected. Thank you so much for the quick solution.
You can try
No of days =
VAR currentDate =
SELECTEDVALUE ( 'Table'[Application date] )
VAR nextDate =
SELECTCOLUMNS (
CALCULATETABLE (
TOPN ( 1, 'Table', 'Table'[Application date], ASC ),
ALLEXCEPT ( 'Table', 'Table'[Field], 'Table'[Product], 'Table'[Type] ),
'Table'[Application date] > currentDate
),
"@val", 'Table'[Application date]
)
RETURN
DATEDIFF ( currentDate, nextDate, DAY )
I tried but it was giving me insufficient memory error.
User | Count |
---|---|
117 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |