Forum Discussion
Samuelroark01
2 years agoNew Member
Need simplification on this DAX code in Power BI
I am attempting to introduce a PPH Value to ALL stations that begin with "Core Table". The PPH value varies at different times of the day to account for break times. All stations will have the same P...
- 2 years ago
Depends on what value type your [Start of Hour] is. Might be enough to use HOUR([Start of Hour])
lbendlin
2 years agoSuper User
Core PPH =
IF (
SEARCH ( [Station], "Core Table", 1, 0 ) = 1,
SWITCH (
TRUE (),
[Start of Hour] IN { 4, 6, 14, 21 }, 121,
[Sartt of Hour] IN { 10, 17 }, 81,
162
),
162
)Samuelroark01
2 years agoNew Member
Thank you so much for the answer. The query ran great, however the hours that are supposed to change to either 121 or 81, are still showing 162. See picture below
- lbendlin2 years agoSuper User
Depends on what value type your [Start of Hour] is. Might be enough to use HOUR([Start of Hour])