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
joannageorge
Frequent Visitor

Created a Date table but values are not accurate

Hi guys! You guys are the most helpful community ever, so here goes my question. 

 

I have created a Date table using the Invoice Date column in my Sales table. It is also marked as date table.

joannageorge_0-1624031517199.png

Below is my relationship view. 

joannageorge_2-1624031720972.png

 

So right now, Im trying to test if the Date table is working correctly. But I noticed that the value is not accurate. I've also posted the expected values from my Excel pivot below for the same customer (Customer A) and same filter 'CA'.

joannageorge_0-1624032002867.png

 

Expected results below. Same customer, same filter on Sales Method. 

joannageorge_1-1624032114883.png

 

Can anyone tell me why this is happening? Any help is greatly appreciated. Thank you soo much! 🙂

 

Cheers.

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Hello @joannageorge ,

this took a while to get my head around. I see 3 issues:

1 - the date table field ('Date') is datetime and it links to invoice date which is date type.  I advise making them both date.  This doesn't affect anything in this model but something to watch out for in future.

2 - watch out for rounding issues. The 'shipped quantity' field is rounded to 2 places but if it's used in any total, the unrounded figure gets used (which may show differences once they're summed).  I've seen this issue but never investigated why powerbi does this.  It might be better to do the rounding in Power Query.

3- This is the cause of the problem you're seeing.  Let's take invoice period 2021-02 as an example.  There are 10 records in the raw data (with the filters applied).  They add up to 1226.  6 of the records have invoice dates in Feb 21 (they add to 782), 4 have invoice dates in March 21 (they add to 443.5).  1226 - 443.5 = 782 which is the figure in the problem visual.

The date table is generated from Invoice date so the four March 21 entries show up in the March section of the matrix.  And this will be similar for other monthly totals that don't match the Excel.

So what are the choices now? : 

You can make a decision about going with invoice date i.e. accept that the current powerbi values are correct. 

OR you can change the relationship from date table -> Invoice fiscal period (I haven't checked this but it looks like this field indicates the Excel data relationship) 

OR you can create a dimension table from the text version of Invoice Fiscal Period - I see it gets changed to date early on in the Power Query transform (this is the main reason it took a while to find the issue as the powerbi data visual all looked correct).

----

 

Let me know what you think

View solution in original post

5 REPLIES 5
HotChilli
Super User
Super User

Hello @joannageorge ,

this took a while to get my head around. I see 3 issues:

1 - the date table field ('Date') is datetime and it links to invoice date which is date type.  I advise making them both date.  This doesn't affect anything in this model but something to watch out for in future.

2 - watch out for rounding issues. The 'shipped quantity' field is rounded to 2 places but if it's used in any total, the unrounded figure gets used (which may show differences once they're summed).  I've seen this issue but never investigated why powerbi does this.  It might be better to do the rounding in Power Query.

3- This is the cause of the problem you're seeing.  Let's take invoice period 2021-02 as an example.  There are 10 records in the raw data (with the filters applied).  They add up to 1226.  6 of the records have invoice dates in Feb 21 (they add to 782), 4 have invoice dates in March 21 (they add to 443.5).  1226 - 443.5 = 782 which is the figure in the problem visual.

The date table is generated from Invoice date so the four March 21 entries show up in the March section of the matrix.  And this will be similar for other monthly totals that don't match the Excel.

So what are the choices now? : 

You can make a decision about going with invoice date i.e. accept that the current powerbi values are correct. 

OR you can change the relationship from date table -> Invoice fiscal period (I haven't checked this but it looks like this field indicates the Excel data relationship) 

OR you can create a dimension table from the text version of Invoice Fiscal Period - I see it gets changed to date early on in the Power Query transform (this is the main reason it took a while to find the issue as the powerbi data visual all looked correct).

----

 

Let me know what you think

Thank you so much for your reply, @HotChilli .

 

We are not able to change the relationship from date to fiscal period (month). Its a many to many relationship and its not a unique value. 

 

I followed your advice and changed fiscal period in query to text form again, and i also used a different date table, now using MDX, and that too works. 

 

Thank you so much for your help. Really appreciate it!

HotChilli
Super User
Super User

It's difficult to say what's wrong without seeing the data and the relationships more fully.

Maybe you can check that the relationship between the date table and fact table is working because I notice that all the dates in the date table have 12:00 am time as well (are they matching correctly to the fact table?). 

If that's all working correctly maybe you can focus your enquiry down to one particular month which shows a difference, hopefully with not too many entries and see what's included or not included.

The 12am time is just the datetime format. I dont think it affects the results. Some deeper digging showed me that it my table was summing up March 2020 + April 2020 data. That is weird. 

Many of the other months also show this problem.

 

Can i DM you my file, and if you could take a look at it, I would greatly appreciate it. 

Sure.  It won't be today but I'll try and look tomorrow

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.