Forum Discussion

Chillytouch's avatar
Chillytouch
Frequent Visitor
4 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    4 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 Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.