Forum Discussion
PowerBI not recognizing text data imported from PostgreSQL when creating visual graphs
I don´t know how to attach a file to a post in this forums, and even though the data i´m working on is just a sample it´s still about 400+ rows to post it here, but i´m gonna try the first 10 lines so you can have an idea. Here is the Sales table:
| ID-Produto | ID-Vendedor | Loja | Data Venda | ValorVenda |
| SKU-0000001 | 1009 | SP8821 | ######## | 679 |
| SKU-0000002 | 1006 | SP8821 | 1/1/2012 | 832 |
| SKU-0000003 | 1006 | SP8821 | 2/2/2012 | 790 |
| SKU-0000004 | 1003 | SP8821 | 3/3/2012 | 765.32 |
| SKU-0000005 | 1004 | SP8821 | 4/4/2012 | 459.89 |
| SKU-0000006 | 1005 | SP8821 | 4/5/2012 | 590.98 |
| SKU-0000007 | 1006 | SP8821 | 4/6/2012 | 1000.91 |
| SKU-0000008 | 1007 | A9990 | 4/7/2012 | 1229 |
| SKU-0000009 | 1003 | SP8821 | 4/8/2012 | 1300 |
The data is in brazillian portuguese. The first column is the id of the product, the second is the id of the salesman, the third is the store, the fourth is the date of the sale (day/month/year), and finally the last one, the one that matters for the exercise, is the monetary value of the sale. The next table is for the product:
ID NOME CATEGORIA SEGMENTO MARCA
SKU-0000002 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000007 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000009 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000011 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000012 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000013 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000014 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000015 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
SKU-0000028 Geladeira Duplex Eletrodomésticos Doméstico Brastemp
From left to right we have id, name, category, segment and brand. In the category column, for the first 10 rows we have only one type, Eletrodoméstico (home appliance), but for the entire set of data we also have small appliances, cellphones and eletronics.
Now here is where my problem lies: when i create a simple graph, a bar graph, placing ValorVenda (sales value) on the y axis and Categoria (category) on the x axis, i only get one bar for the categories when i should be getting 4. And the nameplate for the category is blank. I also get this error when i try to create the same graph with any other part of the data that isn´t a number (date or monetary). I never had this problem with Power BI, i´ve only run into it in this particular class i suspect because we are required to load the data first to PostgreSQL and then import it to Power BI to simulate we are managing a data base. So i think the issue might have something to do with PostgreSQL. Any thoughts?