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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
NeedMorePower
Regular Visitor

Sql request gives a data source error

When I import data from Sql Database it would work without problem. When I split a colum an ODBC data source error occurs. 

Why this happens?

 

Regards 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @NeedMorePower 

What is the error message?

Could you show me the code in Advanced editor?

 

Best Regards
Maggie

Hi Maggie

 

Thanks for your reaction. I was in holiday. I can load the data form SQL to power bi with the following querry:

SELECT TOP 1000000 lv.[LinkID], s.SensorID,s.Auftragsnummer ,lv.[VORNR],j1.[StatusID],j1.[Timestamp],j2.[StatusID],j2.[Timestamp],CAST(j2.[Timestamp] - j1.[Timestamp] as time) as Diff_h, afvc.LTXT, makt.MATNR, makt.MAKTX
FROM [P76].[SensorIDLink] as s
INNER JOIN [P76].[LinkVorgänge] as lv ON s.LinkID = lv.LinkID
INNER JOIN [P76].[StatusJournal] as j1 ON j1.LinkID = lv.LinkID AND j1.VORNR = lv.VORNR AND j1.StatusID = 'RDY' AND j1.Timestamp > '01.01.2019'INNER JOIN [P76].[StatusJournal] as j2 ON j2.LinkID = lv.LinkID AND j2.VORNR = lv.VORNR AND j2.StatusID IN ('FAIL') AND j2.Timestamp > '01.01.2019'
INNER JOIN SAP.[P76].AFKO as afko ON afko.AUFNR = s.Auftragsnummer
INNER JOIN SAP.P76.AFVC_STR as afvc ON afko.AUFPL = afvc.AUFPL AND '0200' = afvc.VORNR
INNER JOIN SAP.P76.RESB as resb ON afko.RSNUM = resb.RSNUM AND resb.POSNR = '0130'
INNER JOIN SAP.p76.MAKT as makt ON resb.MATNR = makt.MATNR and makt.SPRAS = 'D'
WHERE lv.ShopfloorId = 'EL104'

I can load the data in Power BI. But when i change Datatype or take away duplicates it is not possible to save an close the datasource. then the following failure comes back

OLE DB- oder ODBC-Fehler : [DataSource.Error] Fehler beim Lesen von Daten aus dem Anbieter: "Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.".

 

Have you an explanation for this behaviour and what should I change, the query works in SQL 

 

Thanks and Regards


Adrian

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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