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

Date table connection cause wrong average calculation

Hi All, 

I am newbie for power bi, and stuck in trouble. 

My data is based on time stamp (every 15 mins), and values from sensors as like below. 

ohjjang_0-1660651534837.png

When i put value just on Card, and select average value results coming with 3.79 M, i assume all average value from (1st July to 31 July), but when i put slicer with date with setting 1/7/2022 to 31/7/2022 the average value is changing as like below to 3.76. 

I hope to get 3.79 value because when i do average at excel, could get this number instead 3.76. 

I guess date filter effect on my report somehow but do not know exact reason...

I have tried various things to figure out recreate date table, and using calculate with values etc, i could not figure out. 

Could you please help newbie? 

ohjjang_1-1660651653052.png

with slicer based on date

ohjjang_2-1660651986831.png

 

1 ACCEPTED SOLUTION

@ohjjang So does you Date table contain just dates or dates and timestamps? The issue with just Dates in your case is that these will not match up with dates other than timestamps of 00:00:00 (midnight).


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@ohjjang My guess, and this is only a guess, is that setting the slicer sets the end time to be the date and 0 time (midnight) and thus excludes an entire day's worth of data?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you Greg, 

I did slicer setting 'between' and, only could choice date as correct... do not know how to choice even time for selecting midnight. I just add some more screen captures for your consideration. Thanks again for your help. 

ohjjang_0-1660658334323.png

 

ohjjang_1-1660658531697.png

 

 

@ohjjang Oh, I think I see the problem now (maybe). So what if you use Column1 in your slicer instead of your Date column from your Date table? And that's really strange if you have a Date table with a 1:1 relationship with a column that contains date/time values. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Hi again, Thanks a lot for your advice. 

Yes your approach is work when i use column1 on slicer.

But for me, i have dozens of dataset exactly same format with Date / Time column (Time stamp) and values. 

Hope to generate useful report comibining / calculation with datasets in same format, that is why i put date table for slicing...

Yes you mentioned, and i looked online most of relationship with date table is one to many, single direction. But it seems i should use different philosophy....do you have any idea?    

@ohjjang So does you Date table contain just dates or dates and timestamps? The issue with just Dates in your case is that these will not match up with dates other than timestamps of 00:00:00 (midnight).


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you Sir, you are correct. I have just made normal Date table as easily getting information online, and this cause average values only time 00:00:00. So i have tried rebuild my date table which has hours and minuites than i could get matched value. Thanks Greg again!

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