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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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 @Anonymous ,

 

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

3 REPLIES 3
211
New Member

suck my **bleep** ditckis.

 

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

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

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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