cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dsingh
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"

7 REPLIES 7
v-yingjl
Community Support
Community Support

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.

Thank you so much. It worked!!

Dsingh
Helper I
Helper I

Please see the below . Getting this error after pivoting

 

 
 

Capture.PNG

harshnathani
Super User III
Super User III

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!!

amitchandak
Super User IV
Super User IV

@Dsingh ,

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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

@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!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors