Forum Discussion
Compare with Monthly and Daily Target
- 3 years ago
Hi Junaid11 ,
According to your description, here's my solution.
Sample:
Target table:
Table:
Note: Month/Year column in Target table is date type, but MonthYear column in Table is text type.
Here's my solution, create two measures:
DailyTargetPercentage = VAR _Compelete = COUNTROWS ( 'Table' ) VAR _Target = MAXX ( FILTER ( 'Target', EOMONTH ( 'Target'[Month/Year], 0 ) = EOMONTH ( MAX ( 'Table'[Date] ), 0 ) && 'Target'[User Name] = MAX ( 'Table'[User] ) && 'Target'[Category] = MAX ( 'Table'[Category] ) ), 'Target'[Daily Target] ) RETURN DIVIDE ( _Compelete, _Target )MonthlyTargetPercentage = VAR _Compelete = COUNTROWS ( 'Table' ) VAR _Target = MAXX ( FILTER ( 'Target', EOMONTH ( 'Target'[Month/Year], 0 ) = EOMONTH ( MAX ( 'Table'[Date] ), 0 ) && 'Target'[User Name] = MAX ( 'Table'[User] ) && 'Target'[Category] = MAX ( 'Table'[Category] ) ), 'Target'[Monthly Target] ) RETURN DIVIDE ( _Compelete, _Target )Get the result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Junaid11 ,
According to your description, here's my solution.
Sample:
Target table:
Table:
Note: Month/Year column in Target table is date type, but MonthYear column in Table is text type.
Here's my solution, create two measures:
DailyTargetPercentage =
VAR _Compelete =
COUNTROWS ( 'Table' )
VAR _Target =
MAXX (
FILTER (
'Target',
EOMONTH ( 'Target'[Month/Year], 0 ) = EOMONTH ( MAX ( 'Table'[Date] ), 0 )
&& 'Target'[User Name] = MAX ( 'Table'[User] )
&& 'Target'[Category] = MAX ( 'Table'[Category] )
),
'Target'[Daily Target]
)
RETURN
DIVIDE ( _Compelete, _Target )
MonthlyTargetPercentage =
VAR _Compelete =
COUNTROWS ( 'Table' )
VAR _Target =
MAXX (
FILTER (
'Target',
EOMONTH ( 'Target'[Month/Year], 0 ) = EOMONTH ( MAX ( 'Table'[Date] ), 0 )
&& 'Target'[User Name] = MAX ( 'Table'[User] )
&& 'Target'[Category] = MAX ( 'Table'[Category] )
),
'Target'[Monthly Target]
)
RETURN
DIVIDE ( _Compelete, _Target )
Get the result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.