Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Adjusting x-axis by filtering datetime table by two event time stamps

Hello,

I'm a PBI beginner and enthousiast. I am looking for a way to filter a datetime table by means of two datetime stamps coming from another filtered table. I have multiple objects performing multiple sequential events all with a start time and stop time. In a separate table I have measurements on these objects. This measuremtent table has datetime stamps for a whole two days. However, I want my graph to filter the x-axis (= datetime) on the selection of the object, and subsequentially the subsets of events with a start time and stoptime. At the moment I'm using the Time Brush visual to manually filter my graphs, but I would like to do this automatically. Some hints would be Highly appreciated.

2020-10-07_22h49_09.png

 

2020-10-07_22h49_38.png

 

2020-10-07_22h49_57.png

 

 

 

3 REPLIES 3
MFelix
Super User
Super User

Hi @Anonymous ,

 

Not really sure if I understand your requirements but believe that you need to have a filtering based on the start and end times correct?

 

You need to create a dimension table for the dates / times and then make your measure accordingly to the values selected.

 

check this post that looks at creating the tables you need.

https://kohera.be/blog/power-bi/how-to-create-a-time-table-in-power-bi-in-a-few-simple-steps/


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hello Miguel,

 

thank you for your reply. I already have a datetime table. See attached model.

2020-10-09_15h17_09.png

I made a graph with data from the TOTAAL[flow2] and Datetable[Datetime]. I would like to filter this graph or filter the datetable between CIP REALIZED[EventStart] and CIP REALIZED[EventStop] based on a filter from my page. The filter on my page produces a unique start and stop datetime stamp based on the selection of a unique Units[Unit nr].

I tried the related function in a filter, but that does not work. 

Do you have other suggestions? Thank you in advance.

 

Hi @Anonymous ,

 

You should create a measure similar to the one below:

 

Measure = CALCULATE(
SUM(Table[Column]),
Filter(Table, Table[Start] >= Min(Datetable[Datetimecolumn]) && Table[End] <= Max(Datetable[Datetimecolumn]))

 

Be aware that for this you need that the datetime table you are using is disconnected.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.