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
jbirrer
Regular Visitor

Tabular Model gives different results than SQL Query

I am having trouble with some records and how they are aggregating inside our Tabular Model compared to our Data Warehouse.

I have a custom query built that pulls a record number, the order of the records, and a count associated with those records.

When i run the source query (same that is in the tabular model) against the DWH directly, i get this result, which is correct:

SQL Correct.png

 

When I pull the same fields directly from the Tabular model (from a table built using the query yielding the above results), I get this result, which is incorrect:

 

PBI Incorrect.png

 

I get the same result browsing the model directly in SSMS and if i import the data to Power BI. I have tried disconnecting all relationships from the table in the model and it does the same thing. I have traced the DAX query and executed it against the SSAS DB directly and I get the same result (incorrect). I should be seeing a count of zero on OfferOrder 1-4, but for some reason, the Tabular Model is calculating a count of 1 on the 4th offer. I don't really know what else to do at this point. Any ideas?

1 ACCEPTED SOLUTION

This issue is resolved now.  I have partitions on some tables in our Model and the date I was partitioning on was the wrong date, so the records were being counted in both partitions instead of having the entire record sitting in only 1 partition.

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @jbirrer ,

 

Could you please share the formula you are using to generate "OfferTransportCount" if it does not contain any confidential information? Is there any record in your datatable that OfferOrder=4? Please don't have any Confidential Information or Real data in your reply.

 


Best regards,

 

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

@v-lid-msft 

Here is the raw data for this "Call."  The only thing that stands out to me is that Offer #5 happened the next day (which is a valid use case).  The OfferTransportCount field is just a whole number value.  If i just import this data set to Power BI, the data looks fine, but for some reason, when i pull the data from our Model, it gives a TransportCount to Offer #4.  I am using the exact same query when pulling the data directly from the database and as the source query for the tabular model table.  Does this help at all?

 

CallNumberOfferDateOfferTimeOfferOrderOfferTransportCount
19-11988A2019-04-3018:07:21.000000010
19-11988A2019-04-3018:07:38.000000020
19-11988A2019-04-3018:11:43.000000030
19-11988A2019-04-3018:11:53.000000040
19-11988A2019-05-0100:42:02.000000051

This issue is resolved now.  I have partitions on some tables in our Model and the date I was partitioning on was the wrong date, so the records were being counted in both partitions instead of having the entire record sitting in only 1 partition.

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.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.