Forum Discussion
DPCCGF
Helper IV
2 years agoDAX If Statement with Unrelated Table
Hi all, I have two tables, one called Call for Services and one called Shift. The Call for Services, each record, has a Department (there are 26 departments). The Shift table has all the Department...
vanessafvg
Community Champion
2 years agoits always best to provide sample data if you want your questioned answer as this makes it easier to provide a solution.
see pbix attatched if my assumptions are correct
shift =
VAR dept =
SELECTEDVALUE ( calls[dept] )
VAR calltime =
MAX ( calls[call time] )
VAR result =
CALCULATE (
MAX ( shifts[shift] ),
shifts[department] = dept
&& calltime >= shifts[shift start time]
&& calltime <= shifts[shift end time]
)
RETURN
result
DPCCGF
Helper IV
2 years agoVanessa, were you able to see my last post about formatting of fields to all TIME, both from your example and mine? And yours is working and mine is not. Could it be that I am doing a Direct Query model?