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
Anonymous
Not applicable

Error while Refreshing data on power bi Desktop

Hello,

 

I have a PowerBi desktop file connected to SQL Server (import data model)

 

its working fine for few months now.

 

today i tried to refersh the data and it says there's a duplicate in one of the TrxID entries (TrxID values should be unique since they are the primary key) i discussed this with the developer and he assured me the error and fixed it in the DB.

 

but again if i try to refersh it says the TrxID column has duplicates. 

here is a screen shot..

 

ERRORERROR

 

what should i do?

 

appreciate your help

11 REPLIES 11
Anonymous
Not applicable

UPDATE:

 

if I refresh data i get 7 duplicate values in the transactions. i have the duplicate values in my data model, not in the data base. i just confirmed that. 

 

Now im getting crazy. why are there duplicates in my data model though the source dont have duplicates. ?

 

here is a screenshot from my db. as you notice the entries only appear once.

 

SC from DBSC from DB

 

and here is my power bi report showing duplicates after the update. 

pbsc.png

 

i suspected this is because of cached data, i cleared cache from <Options> but did not work. 

 

I appreciate you support gentelmen. 

Hi @Anonymous ,

Please refer this documentation to remove permission of SQL server data source and reconnect it. Later check if the issue still persist...

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello @v-yiruan-msft 

Thank you for your responce.

 

the link to document is broken.

 

I have an update here:

 

i found a value that powerbi is considering as duplicate here is the image from my db:

 

the 00 in the starting of the TrxID is considered duplicate in powerbithe 00 in the starting of the TrxID is considered duplicate in powerbi

 

there are 7 values considered duplicates as per power bi that start with 00

 

NOTE: in powerbi the data type of TrxID is TEXT

 



what can i do about them?

Hi @Anonymous,

Sorry for bringing your inconvenience. Here is the correct link address. It seems when these values with prefix several 0 be removed automatically after import into Power BI... Later I will check the possible method to avoid it. Any progress I will update you.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for your support @v-yiruan-msft 

 

i qoute from your reply

 

"it seems when these values with prefix several 0 be removed automatically after import into Power BI... Later I will check the possible method to avoid it."

 

I think this is the problem. in sql the data type is navchar, and in powerbi it is TEXT . the prefix of Zeros is getting deleted automatically. 

 

how can I fix this.

 

Best

 

 

Hi @Anonymous ,

The prefix 0 may be automatically deleted in the "Change Type" applied step(see below screen shot). So try to find this applied step and delete it in Query Editor to check if the corresponding 0 can be displayed.

missing leading 0.JPG

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello Rena, @v-yiruan-msft 

 

Thank you for your sincere support, the issue is completely resolved. 
I also thank the other contributors for their genuine intrest to give advise.

 

Best

amitchandak
Super User
Super User

@Anonymous , open Data transformation mode/ edit query. Go to the table and try to delete the duplicate .

 

refer : https://radacad.com/remove-duplicate-doesnt-work-in-power-query-for-power-bi-here-is-the-solution

 

Anonymous
Not applicable

thank you for your reply. but your suggestion is not working. there is no duplicate in the db im 100% sure, niether its in the data model. delete duplicates wont work. 

 

any other suggestions?

 

NB: data updates daily in the server, and i have to refresh it in the powerbi model.

Check for blank or null values too.  In Data View, when you highlight that column, does the # of distinct values equal the number of rows?  That's where I start when troubleshooting duplicates on key columns.  If needed, you can make a table visual with the values from the column and a measure that counts the rows and look for which one is >1.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable


@mahoneypat wrote:

Check for blank or null values too.  In Data View, when you highlight that column, does the # of distinct values equal the number of rows?  That's where I start when troubleshooting duplicates on key columns.  If needed, you can make a table visual with the values from the column and a measure that counts the rows and look for which one is >1.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat


Thanks for the suggestion, i did as you said, check my UPDATE

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.