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
moeconsult
Helper V
Helper V

undefinedhe function SUMX cannot work with values of type String

I need help fixing this error please, I am not summing any strings

Error Message:
MdxScript(Model) (8, 274) Calculation error in measure 'Sheet5'[Total Cost]: The function SUMX cannot work with values of type String. Attached file has all my formulas

 

 

Please see link to Pbfile here 

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @moeconsult ,

 

Modify the measure like this:

 

hh1.PNG

 

Total Cost = 
VAR x = [Course Duration]*([Facilitator Fee]+[Venue Fee]+[Facilitator Fee])
RETURN
IF(
    HASONEVALUE('Sheet5'[StartDate]),
    x,
    SUMX(
        SUMMARIZE(
            'Sheet5',
            'Sheet5'[StartDate],'Sheet5'[CourseName],
            "ABCD", x
        ),
        [ABCD]
    )
)

 

 hh2.PNG

 

Best regards,
Lionel Chen

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

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @moeconsult ,

 

Modify the measure like this:

 

hh1.PNG

 

Total Cost = 
VAR x = [Course Duration]*([Facilitator Fee]+[Venue Fee]+[Facilitator Fee])
RETURN
IF(
    HASONEVALUE('Sheet5'[StartDate]),
    x,
    SUMX(
        SUMMARIZE(
            'Sheet5',
            'Sheet5'[StartDate],'Sheet5'[CourseName],
            "ABCD", x
        ),
        [ABCD]
    )
)

 

 hh2.PNG

 

Best regards,
Lionel Chen

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

 

amitchandak
Super User
Super User

Check data Type. Seems like it is text. Try to change it to number

Data Format.pngDatatype in new ribbion.png

 

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.