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
Anonymous
Not applicable

Average of parameter

Hi all,

 

I am trying to create a card visual that can be filtered by a field parameter. I created a field parameter (Test parameter) that contains 3 question fields (Q1, Q2, Q3). The card visual should show the AVERAGE score of the question that is selected in Test parameter. I tried creating a measure with the following DAX formula: Average score = AVERAGE(Test parameter[Test Parameter Fields]) but when I pull this measure into the card visual it says "The function AVERAGE cannot work with values of type String." I am certain the Q1, Q2, and Q3 are numeric fields so can someone let me know what I am doing wrong and how can I get this visual to work please?

 

I attached a sample dataset, let's call this [Test]. Hopefully this could help in answering my question!

TEST IDQ1Q2Q3TEST TYPE
123311PRE
124124PRE
125212PRE
126534POST
127452POST
128241POST

 

Thank you all in advance!

Sheng

1 ACCEPTED SOLUTION
johncolley
Solution Sage
Solution Sage

Hi @Anonymous ,

 

You are receiving that error because you are trying to average the Test Parameter Fields column if you look at that column you will see it's a text field. 

 

You should create a measure to calculate the average of each question and then use those measures in your parameter. For example,

 

Avg Q1 = average(Q1) 

Avg Q2 = average(Q2) 

Avg Q3 = average(Q3) 

 

Then use Avg Q1, Avg Q2 & Avg Q3 as the parameter options.

 

If this answer solves your problem please mark it as a solution!

View solution in original post

2 REPLIES 2
johncolley
Solution Sage
Solution Sage

Hi @Anonymous ,

 

You are receiving that error because you are trying to average the Test Parameter Fields column if you look at that column you will see it's a text field. 

 

You should create a measure to calculate the average of each question and then use those measures in your parameter. For example,

 

Avg Q1 = average(Q1) 

Avg Q2 = average(Q2) 

Avg Q3 = average(Q3) 

 

Then use Avg Q1, Avg Q2 & Avg Q3 as the parameter options.

 

If this answer solves your problem please mark it as a solution!

Anonymous
Not applicable

It worked. Thank you very much!

 

I have a follow-up question that could use some help too - If I have another frequency chart that is filtered based on the question fields themselves instead of the average, would it be possible to create a field parameter that filters both the card visual mentioned in my initial question and this frequency chart?

 

This frequency chart shows the count of distinct score for each question (imagine x-axis as distinct score 1,2,3,4,5 and y-axis as frequency).

 

Thank you again for your help!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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