12-13-2018 10:53 AM - last edited 12-13-2018 11:02 AM
Does for time what DATEADD does for dates.
TIMEADD = //User setttings VAR __add = IF(MAX(Operations[Operation])="SUBTRACT",FALSE(),TRUE()) VAR __unit = MAX(Unit[Unit]) VAR __units = [Units Value] VAR __time = NOW() //Change to desired time value if necessary //Constants VAR __hour = 1/24 VAR __minute = __hour/60 VAR __second = __minute/60 //Calculations VAR __sign = IF(__add,1,-1) VAR __unit2use = SWITCH(__unit,"HOURS",__hour,"MINUTES",__minute,"SECONDS",__second,0) RETURN __time + 1*__sign * __units * __unit2use
@Greg_Deckler This seems far too simple for something that is so powerful. Great effort, mate.
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias