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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
JemmaD
Helper V
Helper V

Sum a column which contains multiple data types

Hi there,

I have a column which contains decimals, dates and text. I want to sum it when the data type is decimal, and ideally just show the text or date values unaggregated - but if this is not possible, to just ignore non-decimal values.

Is this possible with some sort of IFERROR? I've tried but am not getting the right syntax.

 

My column name is [value] and my table name is 'Exception Details'

4 REPLIES 4
Gabry
Super User
Super User

Hello,

did you try something like this?

 

SumOfDecimals =
SUMX(
'Exception Details',
IF(
ISNUMBER('Exception Details'[value]),
'Exception Details'[value],
0
)
)

Thanks @Gabry - the measure no longer errors, however it just shows 0 for everything, even when I filter the value column so I know it's just decimal numbers. I think the issue could be because the column type is text, the IF(ISNUMBER is not picking up the numbers. 

I understand, can't you set up the data type to any in power query? Just wondering. If not maybe you can try convert it

 

SumOfDecimals =
SUMX(
'Exception Details',
IF(
ISERROR(CONVERT('Exception Details'[value], DOUBLE)),
0,
CONVERT('Exception Details'[value], DOUBLE)
)
)

I found a data type column, so i've actually used M Query conditional columns to create separate columns for the different data types. Then my measures can work independently. Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.