Forum Discussion

jbirrer's avatar
jbirrer
Regular Visitor
6 years ago
Solved

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:

 

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:

 

 

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?

  • 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.

3 Replies

    • jbirrer's avatar
      jbirrer
      Regular Visitor

      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
      • jbirrer's avatar
        jbirrer
        Regular Visitor

        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.