Forum Discussion

047's avatar
047
Frequent Visitor
4 years ago
Solved

Choose aggregation function dynamically

Hi   For measurement 'X', my table already has aggregated data which is aggregated using pandas before being imported into power BI. For example:   Product Country X_Mean X_90Percentile ...
  • v-jingzhang's avatar
    4 years ago

    Hi 047 

     

    The new preview feature Field parameters is probably what you want. Since your data is pre-calculated in different columns, you just need to select data from different columns when switching the choices. You can create separate measures like below to get values from single columns. Then create a field parameter and add these measures to the parameter. Use the field parameter in your visual to switch the aggregations. 

    Mean value = SELECTEDVALUE('Table'[X_Mean])
    90Percentile Value = SELECTEDVALUE('Table'[X_90Percentile])

    Other reference: How to dynamically switch between measures in Power BI visuals with Field Parameters 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.