Forum Discussion
designertechno
8 years agoFrequent Visitor
Date calculations are all US based.
Trying to do simple things like subtract one date from another in Power BI Desktop and the results are all US based. Days = DATEDIFF("01/01/2018", "10/01/2018", DAY) Result of the above is ...
Anonymous
8 years agoNot applicable
This is just an example. You can modify this DAX to make it work on your env. As the example below, use Min/Max function to get the min/max date in your table. And then fill into the DATEDIFF function.
DATEDIFF itself only counts date in MM/DD/YYYY format.
Measure =
DATEDIFF (
DATE ( YEAR (
MIN ( MARMS[Date] )
), MONTH (
MIN ( MARMS[Date] )
), DAY (
MIN ( MARMS[Date] )
) ),
DATE ( YEAR (
MAX ( MARMS[Date] )
), MONTH (
MAX ( MARMS[Date] )
), DAY (
MAX ( MARMS[Date] )
) ),
DAY
)
designertechno
8 years agoFrequent Visitor
Would you happen to know where this limitation is documented? Seems like a glaring oversight if true?
The problem is actually locale however as
Dayyy = DAY("01/10/2018")returns 10.