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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
prathamesh0112
New Member

new mwasure error in power pivot

I'm working on a new measure for current year spending. I received the following error: 

 

This formula is invalid or incomplete: 'Calculation error in measure 'Spending'[CY Spending]: The function SUM takes an argument that evaluates to numbers or dates and cannot work with values of type String.'.

 

Measure name: CY Spending

Formula:

=
VAR CY = MAX('Calendar'[Year])
RETURN
CALCULATE(SUM([Spending]),'Calendar'[Year]=CY)

 

please help me.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @prathamesh0112 
According to the error message your column's "spending" data type is a string.
Modify it to a number and the formula should work.

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

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @prathamesh0112 
According to the error message your column's "spending" data type is a string.
Modify it to a number and the formula should work.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.