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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
NickolajJessen
Solution Sage
Solution Sage

Help with stored SQL procedure in Power-query

Problem: An Amount is changing from "+" to "-" during my SQL-procedure.

I'm not sure if the problem is with BI or my SQL-query (probably the latter)

This only happens to this single record. All other records are fine.

 

NB.
Ordrenummer = Order number
Finanskonto = Financial Account

Beløb = Amount

Dato = Date

 

It's perfectly fine when looking it up in the database with a simple query.

BI 21-02 2.PNG

But when loading it into BI, it changes....

BI 21-02.PNG

 

 

This is the SQL procedure i use

 

BI 21-02 3.PNG

1 ACCEPTED SOLUTION

Hello, Thank you for your reply

 

Your response let me on the right track. Changing the type of JOIN didn't do anything, but removing the entire JOIN resulted in only 2 rows beeing returned by the query.. Meaning it was a 'simple' matter of havning duplicate data produced by the JOIN. Added DISTINCT and now it works like a charm.

 

Here are two links, if anyone should ever come across this thread with a simular issue:

 

https://stackoverflow.com/questions/3270335/sql-query-producing-duplicate-rows-and-i-cant-see-why

 

https://teamsql.io/blog/?p=2140

View solution in original post

2 REPLIES 2
d_gosbell
Super User
Super User

This does not look like a Power BI issue. The data in Power BI matches the screen shot from your stored procedure. So you need to figure out why the output of you stored proc and your query are different. It could be due to the FULL JOIN. I don't think this looks right. I would guess that maybe this should be an inner or left join, but I don't know anything about your data so I could be mistaken. 

Hello, Thank you for your reply

 

Your response let me on the right track. Changing the type of JOIN didn't do anything, but removing the entire JOIN resulted in only 2 rows beeing returned by the query.. Meaning it was a 'simple' matter of havning duplicate data produced by the JOIN. Added DISTINCT and now it works like a charm.

 

Here are two links, if anyone should ever come across this thread with a simular issue:

 

https://stackoverflow.com/questions/3270335/sql-query-producing-duplicate-rows-and-i-cant-see-why

 

https://teamsql.io/blog/?p=2140

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors