Forum Discussion

BryanWhellams's avatar
BryanWhellams
Frequent Visitor
8 years ago

SQL returning different rows in Power BI Desktop and Excel

Hi all, 

 

It seems when I run the following SQL query in Excel from Power Query I get different results from when I run it in Power BI Desktop:

 

SELECT "DBase"."SalesAgent", "DBase"."LeadID", "DBase"."Surname", "DBase"."PostCode", "DBase"."ApptDate", "DBase"."ResultOfAppt", "DBase"."LeadDate", "DBase"."ContactMade", "DBase"."ContactDate", "DBase"."OrderPoints", "DBase"."OrderValue", "DBase"."AdSource", "DBase"."LeadType", "DBase"."Status"
FROM "DBaseDetails"."dbo"."DBase" "DBase" WITH (NOLOCK)
WHERE ("DBase"."LeadType"=N'0800 tlc ppc' OR "DBase"."LeadType"=N'0800 WWW ADJ' OR "DBase"."LeadType"=N'0800 www brand leads' OR "DBase"."LeadType"=N'0800 www direct leads' OR "DBase"."LeadType"=N'0800 www leads' OR "DBase"."LeadType"=N'0800.' OR "DBase"."LeadType"=N'tlc ppc' OR "DBase"."LeadType"=N'WWW ADJ' OR "DBase"."LeadType"=N'www brand' OR "DBase"."LeadType"=N'www leads') AND ("DBase"."LeadDate">={ts '2017-01-01 00:00:00'}) AND ("DBase"."ApptDate" <= DATEADD([day], - 1, CONVERT(datetime, GETDATE())))

 

The difference is that Excel returns all rows including when some fields are blank for that record and Power BI omits these rows before any filters are applied. However I need all of the rows that are returned to Excel to show up in Power BI.

 

Is there a setting or something I'm missing?

 

Any help greatly appreciated.

 

Thanks

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi BryanWhellams,


    Can you provide some detail information about this? If power bi contains any remove records steps, you can try to remove 'remove duplicate records' or 'remove blank records' steps to keep all result.

     

    Notice: please do mask sensitive data before uploading.

     

    Regards,

    Xiaoxin Sheng