Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi guys,
I am about to get mad, either I do not see the solution or does not exist 😉
I have data from an Azure SQL server which I do access via direct query and like to keep it as much as possible.
In one table (A) I have a number of records which are structured as element, start date/time, end date/time. In the other table (B) I have events with timestamps only.
I would like to filter the events (B) with timestamps whenever I click, chose one of the records in (A). So basically I need a logic to filter the table (B) with the timestamp between start and and dates from the record in (A).
Is that even possible? I only see a solution in creating a table thats filtered, but that does not look to be possible in a dynamic way.
Any ideas?
Thanks in advance!
Solved! Go to Solution.
Hi @p1ngu1n ,
We can create a measure and use it in visual filter to meet your requirement:
Measure = IF(SELECTEDVALUE(Event_B[Timestamp]) >= MIN('Table_A'[start]) && SELECTEDVALUE('Event_B'[Timestamp]) <= MAX('Table_A'[end]),1,-1)
Best regards,
Hi @p1ngu1n ,
We can create a measure and use it in visual filter to meet your requirement:
Measure = IF(SELECTEDVALUE(Event_B[Timestamp]) >= MIN('Table_A'[start]) && SELECTEDVALUE('Event_B'[Timestamp]) <= MAX('Table_A'[end]),1,-1)
Best regards,
@v-lid-msft Unfortunately I found a problem. This does not work for the first and the last item in the table.
MIN('Table_A'[start])MAX('Table_A'[end]),1,-1) do not return any value for the first and last item in the table.
Any idea why?
Hi @p1ngu1n ,
If you are meaning there are two items such as following in Table A,
| record | start | end |
| First Record | 2019-1-1 00:00:00 | (Blank) |
| ... | ... | ... |
| ... | ... | ... |
| Last Record | (Blank) | 2021-12-31 23:59:59 |
we can try to use the following measures:
Measure =
IF (
MIN ( 'Table_A'[start] ) = BLANK (),
IF ( MAX ( 'Table_A'[end] ) >= SELECTEDVALUE ( Event_B[Timestamp] ), 1, -1 ),
IF (
MAX ( 'Table_A'[end] ) = BLANK (),
IF ( MIN ( 'Table_A'[start] ) <= SELECTEDVALUE ( Event_B[Timestamp] ), 1, -1 ),
IF (
SELECTEDVALUE ( 'Event_B'[Timestamp] ) >= MIN ( 'Table_A'[start] )
&& SELECTEDVALUE ( 'Event_B'[Timestamp] ) <= MAX ( 'Table_A'[end] ),
1,
-1
)
)
)
Best regards,
@v-lid-msft Awesome! That is a really nice and quick solution, working smoothly! Many thanks!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 34 | |
| 21 | |
| 17 |
| User | Count |
|---|---|
| 66 | |
| 64 | |
| 31 | |
| 26 | |
| 26 |