cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Cannot Convert true to text

Hi Team,

Can anyone help me resolve this issue. 

 

This is the sample data set

computer name Status
ASoftware Installed
BSoftware not installed
BService not running
CService not running
DSoftware Installed

 

Expected outcome

Computer name Software InstalledSoftware NotInstalledService Not running
A100
B011
C001
D100

 

I have tried grouping the column and then pivot. Added index column, But still getting an error "OLE DB or ODBC error: [Expression.Error] We cannot convert the value true to type Text.." and in the power query when i look into the error it says "Too many elements in the enumeration to complete"

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Cannot Convert true to text

Hi @Dsingh ,

You can follow these steps to try:

1. Use group by based on 'computer name':

group by.png

2. Add a custom column using this formula:

=let 
    B = [Data],
    #"Removed Other Columns" = Table.SelectColumns(B,{"Status"}),
    #"Grouped Rows1" = Table.Group(#"Removed Other Columns", {"Status"}, {{"Count", each Table.RowCount(_), type number}}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows1", List.Distinct(#"Grouped Rows1"[Status]), "Status", "Count", List.Sum)
    in
    #"Pivoted Column"

3. Remove 'Data' column and expand 'Custom' column

expand column.png

4. Replace values from null to 0 to get the expected result:

replace value.png

 

My sample file is attached that hopes to help you, please check and try it: Cannot Convert true to text.pbix 

 

Best Regards,
Yingjie Li

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

7 REPLIES 7
Highlighted
Super User IV
Super User IV

Re: Cannot Convert true to text

@Dsingh ,

Take a measure count(Table[Status]) +0



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper I
Helper I

Re: Cannot Convert true to text

Hi , Thanks for responding! But i would need the expected outcome in the power query. 

Highlighted
Community Champion
Community Champion

Re: Cannot Convert true to text

Hi @Dsingh ,

 

Apart from the solution mentioned,

 

You can simply put it in a matrix visual.

 

Rows = Computer Name

Column = Status

Value = Count of Status

 

1.jpg

 

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

Highlighted
Super User IV
Super User IV

Re: Cannot Convert true to text

@Dsingh , I doubt you can get without having a numeric column using the unpivot option give below

https://radacad.com/pivot-and-unpivot-with-power-bi



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper I
Helper I

Re: Cannot Convert true to text

Please see the below . Getting this error after pivoting

 

 
 

Capture.PNG

Highlighted
Microsoft
Microsoft

Re: Cannot Convert true to text

Hi @Dsingh ,

You can follow these steps to try:

1. Use group by based on 'computer name':

group by.png

2. Add a custom column using this formula:

=let 
    B = [Data],
    #"Removed Other Columns" = Table.SelectColumns(B,{"Status"}),
    #"Grouped Rows1" = Table.Group(#"Removed Other Columns", {"Status"}, {{"Count", each Table.RowCount(_), type number}}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows1", List.Distinct(#"Grouped Rows1"[Status]), "Status", "Count", List.Sum)
    in
    #"Pivoted Column"

3. Remove 'Data' column and expand 'Custom' column

expand column.png

4. Replace values from null to 0 to get the expected result:

replace value.png

 

My sample file is attached that hopes to help you, please check and try it: Cannot Convert true to text.pbix 

 

Best Regards,
Yingjie Li

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

Highlighted
Helper I
Helper I

Re: Cannot Convert true to text

Thank you so much. It worked!!

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors