Forum Discussion
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 (all Actual) and similar for denominator (all Targets).
https://drive.google.com/drive/folders/1PzbQYPLJXo7ywVjNxjbjxHOfstBG_FOO?usp=sharing
Any thoughts would be amazing, thanks!
3 Replies
- FowmySuper User
GX_1
Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platform and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly? - v-kkf-msftCommunity Support
Hi 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 _attOr 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" ) ) - 1If 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,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-kkf-msftCommunity Support
Hi GX_1 ,
Does your problem have been solved? If it is solved, please mark a reply which is helpful to you.
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