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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors