Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
dubro777
Regular Visitor

AVERAGE based on columns added into a parameter field

I have a set of columns and want to have another column that averages these for each row.
Now the set of columns are in a parameter field, so I still want to have the option to choose which columns get averaged.

So in the below pic, I want a new column named example Rank. but that changes depending on the parameter I have RSI, RPI and QA score in, so I can choose to remove (1) and keep (2) of them.

dubro777_0-1731124119174.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for danextian's concern about this issue.

 

Hi, @dubro777 

I am glad to help you.

 

According to your description, first I created three Measure to calculate the average of different fields:

AvgQS = AVERAGE(Parameter[QA Score])
AvgRPI = AVERAGE(Parameter[RPI])
AvgRSI = AVERAGE(Parameter[RSI])


Then created Fields Parameter with the three fields checked:

vfenlingmsft_0-1731312762763.png

 


At this point my parameter table looks like this:

vfenlingmsft_1-1731312787663.png

 


Then I created a Measure to dynamically fetch the selected parameters while calculating the averages:

example Rank = 
VAR _selectedParameter = CONCATENATEX(VALUES(AverageParameter[AverageParameter Fields]), AverageParameter[AverageParameter Fields], ", ")
RETURN
SWITCH (
    _selectedParameter,
    "'Parameter'[QA Score]", [AvgQS],
    "'Parameter'[RPI]", [AvgRPI],
    "'Parameter'[RSI]", [AvgRSI],
    "'Parameter'[QA Score], 'Parameter'[RPI]",([AvgQS]+[AvgRPI]) / 2,
    "'Parameter'[QA Score], 'Parameter'[RSI]",([AvgQS]+[AvgRSI]) / 2,
    "'Parameter'[RPI], 'Parameter'[RPI]",([AvgRPI]+[AvgRSI]) / 2,
    "'Parameter'[QA Score], 'Parameter'[RPI], 'Parameter'[RSI]",([AvgQS]+[AvgRPI]+[AvgRSI]) / 3
)

 

vfenlingmsft_2-1731312845496.png

 

I have attached the pbix file for this example below, I hope it helps.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for danextian's concern about this issue.

 

Hi, @dubro777 

I am glad to help you.

 

According to your description, first I created three Measure to calculate the average of different fields:

AvgQS = AVERAGE(Parameter[QA Score])
AvgRPI = AVERAGE(Parameter[RPI])
AvgRSI = AVERAGE(Parameter[RSI])


Then created Fields Parameter with the three fields checked:

vfenlingmsft_0-1731312762763.png

 


At this point my parameter table looks like this:

vfenlingmsft_1-1731312787663.png

 


Then I created a Measure to dynamically fetch the selected parameters while calculating the averages:

example Rank = 
VAR _selectedParameter = CONCATENATEX(VALUES(AverageParameter[AverageParameter Fields]), AverageParameter[AverageParameter Fields], ", ")
RETURN
SWITCH (
    _selectedParameter,
    "'Parameter'[QA Score]", [AvgQS],
    "'Parameter'[RPI]", [AvgRPI],
    "'Parameter'[RSI]", [AvgRSI],
    "'Parameter'[QA Score], 'Parameter'[RPI]",([AvgQS]+[AvgRPI]) / 2,
    "'Parameter'[QA Score], 'Parameter'[RSI]",([AvgQS]+[AvgRSI]) / 2,
    "'Parameter'[RPI], 'Parameter'[RPI]",([AvgRPI]+[AvgRSI]) / 2,
    "'Parameter'[QA Score], 'Parameter'[RPI], 'Parameter'[RSI]",([AvgQS]+[AvgRPI]+[AvgRSI]) / 3
)

 

vfenlingmsft_2-1731312845496.png

 

I have attached the pbix file for this example below, I hope it helps.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

danextian
Super User
Super User

Hi @dubro777 

You can't directly apply an aggregation to field parameters.  They have to be used dimensions or to switch between measures configured in the parameter.  You will need to write an IF or SWITCH formula to switch between different averages based on  the field parameters order column. Applying a conditional formula to either the paramter or parameter fields columns, will result to this error:

danextian_0-1731125806280.png

The formula would be something like

test =
SWITCH (
    SELECTEDVALUE ( Parameter[Parameter Order] ),
    1, [Avg1],
    2, [Avg2]
)

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks for your support here.

 

Let me give a bit more info. So the columns within the parameter are measures.

I tried your solution, and will give me the value for each measure in the parameter of only (1) is selected. Which is good, however I need it to Average if more than 1 is selected. So that the overall score changes depending if I am adding more measures. but need it to be dynamic so I can use the parameter slicer to decide which ones. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors