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
DSmith4
Helper II
Helper II

Sum of text values or convert text to number?

Hi, I am trying to sum the dollar amount by vendor.
Our vendor nubmers are alphanumeric so when I do the sum formula I get an error "cannot convert value of type text to type true/false"

 

Is there a way around this? I am trying to create a column so I can add a page level filter for only vendors that have an amount of 100,000 or greater.

I've tried converting vendor to value but it does not work either.

 

Formulas and screenshots are below.

 

Can anyone help?

 

Vendor Sum = CALCULATE(SUM('GRIR Cleared Items'[Amount in LC]),FILTER('GRIR Cleared Items','GRIR Cleared Items'[Vendor]))
 
VendorValue = VALUE('GRIR Cleared Items'[Vendor])
 
2019-10-23_12-43-40.png
 
2019-10-23_12-41-55.png
1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@DSmith4 ,

 

In the first measure, you should add the condition like below:

Vendor Sum =
CALCULATE (
    SUM ( 'GRIR Cleared Items'[Amount in LC] ),
    FILTER ( 'GRIR Cleared Items', 'GRIR Cleared Items'[Vendor] = Condition )
)

About the second measure, please check if the value in column 'GRIR Cleared Items'[Vendor] is text format like "1", "2", "3", etc.

 

Community Support Team _ Jimmy Tao

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
v-yuta-msft
Community Support
Community Support

@DSmith4 ,

 

In the first measure, you should add the condition like below:

Vendor Sum =
CALCULATE (
    SUM ( 'GRIR Cleared Items'[Amount in LC] ),
    FILTER ( 'GRIR Cleared Items', 'GRIR Cleared Items'[Vendor] = Condition )
)

About the second measure, please check if the value in column 'GRIR Cleared Items'[Vendor] is text format like "1", "2", "3", etc.

 

Community Support Team _ Jimmy Tao

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

 

tarunsingla
Solution Sage
Solution Sage

You have tried to use the Vendor field in a Filter condition. Filter condition expects the expression to be true/false.

 

1. In your Vendor SUM calculated measure, drop the filter and instead apply filter in your visual (or Page level or Report Level) on this calculated measure.

 

2. VALUE function does not work that way. It helps convert numbers (that are stored as text), to numbers.

Hi,

 

This field does not allow me to place in a filter

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.