Forum Discussion

JCB's avatar
JCB
New Member
4 years ago

Weighted average - multiple category

Hi, 

 

i am trying to do a weighted average with mulitple categories. I need to multiply the "proportion" by the "capability" depending on filters selected. I have 3 filters: location, platform and scenario. The weighted avg need to update depending on the selections.

 

I've tried the quick measure but didn't allow me to do it with multiple categories... I also tried this syntax since all 3 filters are interacting with the measure/visual but still not working:

 

DIVIDE(
    sumx('2022 Growability baseline','2022 Growability baseline'[Proportion]*'2022 Growability baseline'[capability]),
    sumx('2022 Growability baseline','2022 Growability baseline'[Proportion])
)
 
Any thoughts on how i should approach this?

3 Replies

  • JCB , if Proportion and capability are columns the measure seems correct to me

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • JCB's avatar
    JCB
    New Member

    amitchandak they are both columns and really not returning the good value. Here's the table:

    and the output visual is a bar graph by platform (Y axis is in %)..

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI JCB,

      Perhaps you can try to do unpivot column on your value fields to convert them to attribute and value. Then you can use the attribute field on the legends to group these values.

      Unpivot columns (Power Query) (microsoft.com)

      Regards,

      Xiaoxin Sheng