Forum Discussion
Chillytouch
4 years agoFrequent Visitor
Aggregate values differently based on measure/logic?
Hi, I have a matrix that I created with example data shown below. I have been trying to get my data into a format like this for a while now however I am running into a road block with aggregation...
- Anonymous4 years ago
Hi Chillytouch ,
Do you want to show average if metric_type = "paypercentrev" , and show sum if metric_type = "revenue" or "salary"? I think you can try If function to achieve your goal.
My Sample:
Measure:
Measure = IF(MAX('Table'[metric_type])="paypercentrev",AVERAGE('Table'[Value]),SUM('Table'[Value]))Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
4 years agoChillytouch , if you want to change the calculation based on level you can use isinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/