Forum Discussion
Use a dax calculated table as a measure.
- Anonymous11 months ago
Hi jasemilly ,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Thank you
Remove the INT conversion and use direct date comparison:
Agent Growth for Date Test =
VAR _Agent = SELECTEDVALUE('CallsReviewScore'[Agent Full Name])
VAR _CurrentDate = MAX('Date'[Date])
VAR AgentDates =
SUMMARIZE(
'CallsReviewScore',
'CallsReviewScore'[Agent Full Name],
"Last", MAX('CallsReviewScore'[Created Date]),
"Prev", CALCULATE(
MAX('CallsReviewScore'[Created Date]),
FILTER(
ALL('CallsReviewScore'),
'CallsReviewScore'[Agent Full Name] = EARLIER('CallsReviewScore'[Agent Full Name]) &&
'CallsReviewScore'[Created Date] < MAX('CallsReviewScore'[Created Date])
)
)
)
VAR AgentDatesWithMid =
ADDCOLUMNS(
AgentDates,
"Mid", [Prev] + INT(DATEDIFF([Prev], [Last], DAY) / 2),
"Growth",
VAR PrevScore = CALCULATE(AVERAGE('CallsReviewScore'[Score]), 'CallsReviewScore'[Created Date] = [Prev])
VAR LastScore = CALCULATE(AVERAGE('CallsReviewScore'[Score]), 'CallsReviewScore'[Created Date] = [Last])
RETURN DIVIDE(LastScore - PrevScore, PrevScore)
)
RETURN
MAXX(
FILTER(
AgentDatesWithMid,
[Agent Full Name] = _Agent &&
[Mid] = _CurrentDate
),
[Growth]
)
If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
Hi
Thanks for the response, originally the measure didn't include the int() function I only included to try and resolve issue same goes for the greater than and less than check.
I have just tried again, and I still have the issue