cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Why are these Max measures returning different results?

Hi All,

 

I am trying to get the end date for the most current month the report has date for.  These two measures are identical other than the .Date.  How does that change the result?  What is also odd to me is the last date in that col is 3/30/19, so how is it getting to 12/31/19.  Probably the same answer.  Thanks.

 

Updated date = EOMONTH(max('SITE PERFORMANCE'[Last Screen date]),0)
Last day = EOMONTH(max('SITE PERFORMANCE'[Last Screen date].[Date]),0)
 

Screenshot_1.png

3 REPLIES 3
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

Based on my test, if we haven't transferred a filter to the function .date, .month or .day, it will return the full value. For example, if I use MIN(Table[Column].[Day]), it will return 1, if I use MAX(Table[Column].[Day]), it will return 31. In your scenario, when we use max('SITE PERFORMANCE'[Last Screen date]), it will return the last day of 2019, 12/31/2019, if I use min('SITE PERFORMANCE'[Last Screen date]), it will return 1/1/2019

Best Regards,

Teige

HotChilli
Super User
Super User

I haven't looked into the details but this will be related to the hidden date tables in PowerBi.  Once the .xxxx notation is used, the data is fetched from these tables.  

 

Update: MAX is going to give some interesting results with .MONTH !

tex628
Community Champion
Community Champion

When you do a MAX('Calendar'[Date].[Month]) it returns string values, so it returns the months in alphabetical order!

It's super weird 🙂 


Connect on LinkedIn

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors