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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jtomczyk
Helper I
Helper I

Error in Power Query / Merge queries

Hi, 

I have two queries. In first I have project numbers and many details related to the projects. In the second I have project numbers and requested ship date. I would like to bring that date to the first query. I used merge queries function (left outer).
While merging I got such error.

 

DataSource.Error: AnalysisServices: The argument value passed for Count was negative. Negative values are not supported for Count.
How to fix it?

Regards

JT

3.jpg

1 ACCEPTED SOLUTION
3 REPLIES 3
jtomczyk
Helper I
Helper I

Hi Jennratten,

I saw that post already. I have one sorting on the query (Line Amount Total USD). I cannot remove it as I have to remove duplicates of the projects and keep only the most expensive one. Do you know how to fix the issue with sorting? What creates issues on that step?

4.jpg

 

Is sorting the only thing that happens in that query? Are there any other transformations performed?  If you could post your script that would be helpful.  There are some functions that perform internal counts and others that return internal negative values in the event no matches to a key are found.

 

If sort is the only transformation that is added, I recommend first removing the sort to see if that fixes the problem (to confirm whether or not it actually is the sort causing the problem) - then add it back.

jennratten
Super User
Super User

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.