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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

cannot convert value of type text to type true/false

I am trying to count the number of rows in table Process_FCO by filter the companyname in table Companies.  I am getting the error "cannot convert value of type text to type true/false".  I can not figure out how to correct this.
 
Number of Change Orders=
CALCULATE(
COUNT(Process_FCO[instanceid]),
FILTER(
Companies,Companies[companyname]))
5 REPLIES 5
Anonymous
Not applicable

@nilimarodrigues There is no relationship between FCO & Companies because there is no Company ID within FCO but there is ID in Commitments and both FCO and Commitments is tied to Project via Project_ID

ghe7549_0-1605125062077.png

 

@Anonymous The relationships seem good. You could use Selectedvalue() to get the company value and use it in a measure like:

Number of Change Orders = 
VAR company = SELECTEDVALUE(Companies[CompanyName])
RETURN
CALCULATE(COUNT(Process_FCO[InstanceId]),Companies[CompanyName] = company)

 

I use some sample data to replicate the tables and relationships and it works. Please refer to this PBIX file.

 

Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

nilimarodrigues
Helper III
Helper III

Hello,

 

Is there any relationship between company table and process_FCO table? For example if they have One to Many relationship, if you simply pull the "ID" column and take summarization as "COUNT" - it will give you the count of all process IDs for selected company name. 

 

If there is no relationship, would you be able to share some PBIX file or sample records of tables to understand the question further? 

 

Thanks

Anonymous
Not applicable

@AlB I am using a slicer that is pulling companyname

AlB
Community Champion
Community Champion

Hi @Anonymous 

What is the condition for the filter? Are you looking for a specific company name?  You are just using the column

Companies[companyname] in the second argument of FILTER()

Number of Change Orders =
CALCULATE (
    COUNT ( Process_FCO[instanceid] ),
    FILTER ( Companies, Companies[companyname] = "Name of company here" )
)

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.