Forum Discussion
eraldo_DP
6 years agoFrequent Visitor
How to calculate target by data?
Hi Everyone, How i can calculate the target corresponding to the date and group? https://1drv.ms/u/s!As-s3TNexQ8TipkPATGyYTW6Fbr-qA?e=gLg3Ev
- 6 years ago
Here is a measure expression that returns the Target for the Date and Group on that row of the table.
GroupDate Target = VAR __thisdate = SELECTEDVALUE ( Sales[Date] ) VAR __thisGroup = SELECTEDVALUE ( Sales[Group] ) RETURN CALCULATE ( MAX ( Target[Target Conversation] ), ALL ( Target ), Target[StartDate] <= __thisdate, Target[EndDate] >= __thisdate, Target[Group] = __thisGroup )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- 6 years ago
Perfect, thanks for this solution.
mahoneypat
Microsoft Employee
6 years agoHere is a measure expression that returns the Target for the Date and Group on that row of the table.
GroupDate Target =
VAR __thisdate =
SELECTEDVALUE ( Sales[Date] )
VAR __thisGroup =
SELECTEDVALUE ( Sales[Group] )
RETURN
CALCULATE (
MAX ( Target[Target Conversation] ),
ALL ( Target ),
Target[StartDate] <= __thisdate,
Target[EndDate] >= __thisdate,
Target[Group] = __thisGroup
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
eraldo_DP
6 years agoFrequent Visitor
Perfect, thanks for this solution.