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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors