Forum Discussion
GX_1
5 years agoFrequent Visitor
Filtering measure by specific variables
Hi Everyone! Goal: Filter data by ID, Year, Month for each result. Currently its filtering by ID then aggregating all the years (2020-2021) that fall into the same ID group for the numerator...
v-kkf-msft
Community Support
5 years agoHi GX_1 ,
Try to modify measure Result:
Result =
VAR _Cost =
SELECTEDVALUE ( 'Table'[Cost] )
VAR _act = [Actual]
VAR _forc = [Forecast]
VAR _targ = [Approved Target]
VAR _att =
IF (
ISBLANK ( _act ),
IF ( _Cost = "Forecast", _forc/ _targ - 1 ),
IF ( _Cost = "Actual", _act/ _targ - 1 )
)
RETURN
_att
Or create a new measure:
Measure =
CALCULATE(
SUM('Table'[value]),
FILTER(
'Table',
'Table'[Cost] = "Actual"
|| 'Table'[Cost] = "Forecast"
)
) /
CALCULATE(
SUM('Table'[value]),
FILTER(
'Table',
'Table'[Cost] = "Approved Target"
)
) - 1
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.