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

Measure not working for calculated column

I have written a measure to format a calculated column but am getting an error message.

 

The measure is "Variance1 = IF('Forecast Expense'[Variance]=-0, 'Forecast Expense'[Variance]*-1, 'Forecast Expense'[Variance])", where "Variance" is the name of the calculated column. This measures is supposed to ensure that any nil result shows as "0%" and not "-0%".

 

The calculated column is "Variance = calculate(divide(sum('Actual Expense'[Expense Amount])+sum('Forecast Expense'[Forecast Amount]),sum('Initiative Funding'[Amount]))-1)".

 

The error message is "A single value for column 'Variance' in table 'Forecast Expense' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.".

 

The formula appears to be wanting a single result, whereas I am looking for a different result for each row. This is consistent with my research, which suggests that  a measure cannot be applied to a calculated column as one uses rows and the other columns.

 

Is there another way to achieve my objective.

 

Thanks

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can change the measure using MAX function to get values for every rows like DAX below.

 

Variance1 = IF(MAX('Forecast Expense'[Variance])=-0, MAX('Forecast Expense'[Variance])*-1, MAX('Forecast Expense'[Variance]))

 

Best Regards,

Amy

 

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

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can change the measure using MAX function to get values for every rows like DAX below.

 

Variance1 = IF(MAX('Forecast Expense'[Variance])=-0, MAX('Forecast Expense'[Variance])*-1, MAX('Forecast Expense'[Variance]))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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