Forum Discussion
sprakash99
4 years agoFrequent Visitor
How to select one particular row and column value using DAX
I have a table that stores the timezone related data to perform calculations based on the user selected timezone.
I want to select the Hours and Minutes value from this table for a selected timezone and then convert it as follows:
var curDate =
SWITCH ( TRUE(),
relativeToUTC = ‘Post’, UTCNOW() + TIME(timeZone_hours,timeZone_minutes,0),
relativeToUTC = ‘Pre’, UTCNOW() - TIME(timeZone_hours,timeZone_minutes,0),
)
Here is the table
var curDate = SWITCH ( TRUE(), SELECTEDVALUE('Table'[relativeToUTC] = ‘Post’, UTCNOW() + TIME(SELECTEDVALUE('Table'[timeZone_hours],SELECTEDVALUE('Table'[timeZone_minutes],0), SELECTEDVALUE('Table'[relativeToUTC] = ‘Pre’, UTCNOW() - TIME(SELECTEDVALUE('Table'[timeZone_hours],SELECTEDVALUE('Table'[timeZone_minutes],0), )
3 Replies
- johnt75Super User
var curDate = SWITCH ( TRUE(), SELECTEDVALUE('Table'[relativeToUTC] = ‘Post’, UTCNOW() + TIME(SELECTEDVALUE('Table'[timeZone_hours],SELECTEDVALUE('Table'[timeZone_minutes],0), SELECTEDVALUE('Table'[relativeToUTC] = ‘Pre’, UTCNOW() - TIME(SELECTEDVALUE('Table'[timeZone_hours],SELECTEDVALUE('Table'[timeZone_minutes],0), )- sprakash99Frequent Visitor
But I have a slicer that will let the users to choose the timezone such as Los Angeles. How do I incorporate that filter?
- johnt75Super User
If you put the TimeZone column on the slicer, and choose the force single selection option, then that will do the filtering