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.
I need to report major storm power outages and restorations based on all of the records on or after OutageStartTime and before or on OutageEndTime. There can be multiple outages starting/restored in the same storm event but on differnet dates and times (think major hurricane). The end user needs to be able to choose the start and end time based on the exact times in the data. What is the best way to achieve this? I am fairly new to Power BI and for obvious reasons filters and slicers aren't working.
Major Storm Outage | 2/26/2008 13:48 | 2/26/2008 16:28 |
Major Storm Outage | 2/26/2008 13:48 | 2/26/2008 13:52 |
Major Storm Outage | 2/26/2008 13:49 | 2/26/2008 13:51 |
Major Storm Outage | 2/26/2008 13:59 | 2/26/2008 16:24 |
Major Storm Outage | 2/26/2008 14:10 | 2/26/2008 16:23 |
Major Storm Outage | 2/26/2008 14:10 | 2/26/2008 16:21 |
Solved! Go to Solution.
Hi @Anonymous ;
According to your description, first you have to create a slicertable as a slicer, and then create a measure as a flag. Proceed as follows:
1.Create a new table:
slicertable =
VAR _table1 =
SUMMARIZE ( 'Table', [StartTime] )
VAR _table2 =
SUMMARIZE ( 'Table', [EndTime] )
RETURN
UNION ( _table1, _table2 )
2.Create a flag measure:
flag =
IF (
MAX ( [StartTime] ) >= MIN ( 'slicertable'[Timerange] )
&& MAX ( [EndTime] ) <= MAX ( 'slicertable'[Timerange] ),
1,0)
3. Apply the flag measure into the filter
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ;
According to your description, first you have to create a slicertable as a slicer, and then create a measure as a flag. Proceed as follows:
1.Create a new table:
slicertable =
VAR _table1 =
SUMMARIZE ( 'Table', [StartTime] )
VAR _table2 =
SUMMARIZE ( 'Table', [EndTime] )
RETURN
UNION ( _table1, _table2 )
2.Create a flag measure:
flag =
IF (
MAX ( [StartTime] ) >= MIN ( 'slicertable'[Timerange] )
&& MAX ( [EndTime] ) <= MAX ( 'slicertable'[Timerange] ),
1,0)
3. Apply the flag measure into the filter
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Why dont you create one date between filter and one for the times, that way you can filter for all.
So if I choose dates between 2/26 and 2/28 and then times between 13:59 and 16:23 wouldn't that filter the hours on each of the days, for example if an outage occured on 2/27 at 12:20, it wouldn't be included?
No it will be included. Anything between 2/26 and 2/28 is included same for the times.
Hi, @partymia ;
if you don't want to included it ,you could use slicer and press and hold ctrl for multiple selection, select the date and time you want .
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |