This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
This calc column 8AM-10PM = IF(HOUR(vw_PivotChargesFrontPage[Visits_StartTime]) >= 8 && HOUR(vw_PivotChargesFrontPage[Visits_EndTime]) <= 22 ,TRUE(),FALSE())
returns all calls with a start time on or after 8am & an end time on or before 10pm. Problem is it also returns calls with an end time between 10pm & 10:59pm. In pic below I do not want 22:55, 22: 50 etc
If I add && Minute(vw_PivotChargesFrontPage[Visits_EndTime]) <= 0 then it will exclude calls that end at 8:30am, 19:55 etc
which I don't want.
Solved! Go to Solution.
Would need sample data posted that I can copy and paste, just been hacking up to this point.
Add the following Boolean expression as well.
vw_PivotChargesFrontPage[Visits_StartTime]
<= vw_PivotChargesFrontPage[Visits_EndTime]
8AM-10PM = IF(HOUR(vw_PivotChargesFrontPage[Visits_StartTime]) >= 8 && HOUR(vw_PivotChargesFrontPage[Visits_EndTime]) <= 21 ,TRUE(),FALSE())
Hi Greg,
Thanks for the feedback.
What about calls with an end time of 22:00. They won't be included if I use <=21.
I'd like all calls returned with a start time from 8am onwards & with an end time of 22:00 at the latest.
Expected results ->
8AM-10PM =
IF(
HOUR(vw_PivotChargesFrontPage[Visits_StartTime]) >= 8
&&
(
HOUR(vw_PivotChargesFrontPage[Visits_EndTime]) <= 21
||
(
HOUR(vw_PivotChargesFrontPage[Visits_EndTime]) = 22
&&
MINUTE(vw_PivotChargesFrontPage[Visits_EndTime]) = 0)
)
),
TRUE(),
FALSE()
)Maybe.
Oops, inadvertantly accepted as solution.
Not quite returning what I need.
Add the following Boolean expression as well.
vw_PivotChargesFrontPage[Visits_StartTime]
<= vw_PivotChargesFrontPage[Visits_EndTime]
Yes, thank you. @Greg_Deckler Your code works perfectly with the added expression from @v-chuncz-msft
Cool! The power of teamwork!
Would need sample data posted that I can copy and paste, just been hacking up to this point.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 26 | |
| 25 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 41 | |
| 40 | |
| 21 | |
| 20 |