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

Single value for a column cannot be determined

Hi, 

 

I am trying to create a measure so that I can calculate a rolling 4 interval average (I only have interval # and no date). However when trying to use an index to order the intervals, I receive this error:

 

msylv13_0-1657568126275.png

My data table looks like the following:

msylv13_1-1657568177820.png

 

Thank you for any help!

1 ACCEPTED SOLUTION

@Anonymous 
Inside FILTER, instead of 'Rolling Table', use ALL ( 'Rolling Table' ),

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @Anonymous 
You need to wrap Index with SELECTEDVALUE 

Anonymous
Not applicable

I am unfamiliar with SELECTEDVALUE and am not sure what to enter for the alternate result in the function. Could you provide more detail?

@Anonymous 
Like this 
VAR MyIndex = SELECTEDVALUE ( 'Rolling Table'[Index] )

Anonymous
Not applicable

Thank you. I tried that, however instead of calculating the average over the number of specified intervals the measure just returns the total for each. See below:

msylv13_0-1657573229243.png

 

@Anonymous 
Inside FILTER, instead of 'Rolling Table', use ALL ( 'Rolling Table' ),

@Anonymous 

Would you please copy/paste the code here so I can edit it

Anonymous
Not applicable

Thank you so much! Posting final DAX expression should anybody need to reference it:

 

Moving Average =
VAR MyIndex = selectedvalue('Rolling Table'[Index])
VAR myResult =
AVERAGEX(
FILTER(
ALL('Rolling Table'),
'Rolling Table'[Index] > MyIndex-4 &&
'Rolling Table'[Index] <= MyIndex
),'Rolling Table'[EDD]
)
RETURN FIXED(myResult,2)

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