Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello friends,
I have a set of date/time points (PointsInTime table).
For each point I need to show what event was translated on a TV at that point (Events table).
I used a calculated column in PointsInTime table:
Solved! Go to Solution.
Try the following:
EventWithOverlap = IF ( CALCULATE ( COUNTROWS ( EventsWithOverlap ), FILTER ( EventsWithOverlap, EventsWithOverlap[EventStartDateTime] <= PointsInTime[SomeDateTime] && EventsWithOverlap[EventEndDateTime] >= PointsInTime[SomeDateTime] ) ) > 1, CALCULATE ( FIRSTNONBLANK ( EventsWithOverlap[Event], TRUE () ), FILTER ( EventsWithOverlap, EventsWithOverlap[EventStartDateTime] <= PointsInTime[SomeDateTime] && EventsWithOverlap[EventEndDateTime] >= PointsInTime[SomeDateTime] ) ), BLANK () )
Does that give you what you want?
Let us know if that works for you @michaelshparber
you can try this as Calculated column:
EventWithOverlap = CALCULATE(FIRSTNONBLANK(EventsWithOverlap[Event],0),FILTER(EventsWithOverlap,EventsWithOverlap[EventStartDateTime]<='PointsInTime'[SomeDateTime]&&EventsWithOverlap[EventEndDateTime]>='PointsInTime'[SomeDateTime]))
Try the following:
EventWithOverlap = IF ( CALCULATE ( COUNTROWS ( EventsWithOverlap ), FILTER ( EventsWithOverlap, EventsWithOverlap[EventStartDateTime] <= PointsInTime[SomeDateTime] && EventsWithOverlap[EventEndDateTime] >= PointsInTime[SomeDateTime] ) ) > 1, CALCULATE ( FIRSTNONBLANK ( EventsWithOverlap[Event], TRUE () ), FILTER ( EventsWithOverlap, EventsWithOverlap[EventStartDateTime] <= PointsInTime[SomeDateTime] && EventsWithOverlap[EventEndDateTime] >= PointsInTime[SomeDateTime] ) ), BLANK () )
Does that give you what you want?
Let us know if that works for you @michaelshparber
you can try this as Calculated column:
EventWithOverlap = CALCULATE(FIRSTNONBLANK(EventsWithOverlap[Event],0),FILTER(EventsWithOverlap,EventsWithOverlap[EventStartDateTime]<='PointsInTime'[SomeDateTime]&&EventsWithOverlap[EventEndDateTime]>='PointsInTime'[SomeDateTime]))
I think you could use this Post. Its does a Time-bound Lookup too.
https://community.powerbi.com/t5/Desktop/DATE-RANGE-LOOKUP/td-p/420514
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |