Forum Discussion
Dynamic Filter - Date/Time
- 6 years ago
Hello @leandroparischi ,
Sorry that's why Power BI doesn't support time segmentation being blank if no DATE is selected in date segmentation.
You may be able to create a slicer usingthe date field and place the Time field in Filter. When you select a date, you can select Filter Time.
Or you can try the following shapes, putting the Time in a table visual.
1. Create a Date table and a Time table.
Date table = CALENDAR("2020/1/1","2020/12/31")TimeTable = VAR HourTable = SELECTCOLUMNS(GENERATESERIES((0), (23)), "Hour", [Value]) VAR MinuteTable = SELECTCOLUMNS(GENERATESERIES((0), (59)), "Minute", [Value]) VAR SecondsTable = SELECTCOLUMNS(GENERATESERIES((0), (59)), "Second", [Value]) RETURN ADDCOLUMNS( CROSSJOIN(HourTable, MinuteTable, SecondsTable), "Time", TIME([Hour], [Minute], [Second]))2. Then create a range column in the Time table.
Rank = RANKX(TimeTable,TimeTable[Time],,ASC,Dense)3. Then we can create a measure, put the measurement and range in a visual table.
Time measure = IF( ISFILTERED('Date table'[Date]),MAX(TimeTable[Time]),BLANK())4. If we do not select the date segmentation, the measurement is blank, if we select the date, the measurement will be displayed all the time. Next, we can select the time to filter another table.
If you don't meet your requirements, could you show the exact expected result based on the table we shared?
Best regards
Community Support Team _ zhenbw
If this post helps,then consider Accepting it as the solution to help other members find it more quickly.
BTW, pbix as attached.
leandroparischi Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.