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
Anonymous
Not applicable

SUM Text and Numeric

Hi,

 

Wondering if you can help. 

 

I have data which looks like the following, below dummy data

 

Name Of AppealCodeVolumeStatus
TVFIN10Success
MediaFIN5Failed
PressFIN10Success
EmailXXXOKP

 

I would like to sum up Value where the code is FIN, but The volume field is stored as text because obviously there are string values. I tried to create a filter where by it would include everything with FIN and then convert the Volume Column using the Value, but struggling. I would also need to make sure I only sum the rows with a value of  'success'. 

 

I tried to also do the IFNUMBER at Query Level, but because the entire column is text, it just outputs every row as text. 

 

Any guidance would be appreciated. 

 

6 REPLIES 6
Arjunarao
Resolver I
Resolver I

Hi Figo7

 

Can you show us your expected output?

The pattern to use is

Measure = SUMX(FILTER(Table2, Table2[Code] = "FIN") , VALUE(Table2[Volume]) )

so you're using VALUE for each row in your filtered table.

I'll let you add the 'success' part

Anonymous
Not applicable

I had something similar before & have the same problem. The visual cannot be displayed and the error is because the VALUE function cannot convert the string 'OK' in the colum called Volume.

 

Cannot convert value 'OK' of type Text to type Number

 

@HotChilli 


@HotChilli wrote:

The pattern to use is

Measure = SUMX(FILTER(Table2, Table2[Code] = "FIN") , VALUE(Table2[Volume]) )

so you're using VALUE for each row in your filtered table.

I'll let you add the 'success' part


 

You need to debug it at your side.  I used your data (thanks for providing this, many people don't)

FINValueTotal.PNG

If you link your pbix, I'll have a look

Anonymous
Not applicable

Hi,

The data was an example as I'm working personal identifiable data. I'll debug and explore. 

 

Thanks for your speed reply. 


@HotChilli wrote:

You need to debug it at your side.  I used your data (thanks for providing this, many people don't)

FINValueTotal.PNG

If you link your pbix, I'll have a look


 

Arjunarao
Resolver I
Resolver I

Hi Figo7

Can you show us your expected output?

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.