cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leo_89
Post Prodigy
Post Prodigy

Problem with the filter

Hi there,

 

I am plotting power consumption across 24 hours of the day as shown in the picture.

 

leo_89_0-1623814084179.png

On the left-hand side of the picture, I have few filters. The time of day filter has four values: Morning (from 5 am to 8.59 am), Day (from 9 am to 15:59 ), Evening (16:00 to 21:59), and night (from 22:00 to 4:59). I have coded Time of day values into Time table with the following code:

 

leo_89_1-1623814353496.png

 

When I select the value from time of day filter the line chart visual updates and line chart shows only hours that come into that value as shown in the following picture. For example, if I select the day from time of day filter, line chart shows hour from 9 am to 15. 

 

leo_89_2-1623814510675.png

 

The problem comes in when I select the night value from the time of day filter, it shows all hours of the day as shown in the following picture:

 

leo_89_3-1623814787249.png

The red marked area should not appear. Ideally, it should not show, or at least it does not show the orange line showed in the red marked area.  I am not sure how to get rid away from the line or show only selected hours. Any help would be really appreicated.

Sample file here

1 ACCEPTED SOLUTION
leo_89
Post Prodigy
Post Prodigy

Changing the x-axis type from Continuous to categorical variable and sort by hour fixed the issue.

View solution in original post

2 REPLIES 2
leo_89
Post Prodigy
Post Prodigy

Changing the x-axis type from Continuous to categorical variable and sort by hour fixed the issue.

View solution in original post

amitchandak
Super User IV
Super User IV

@leo_89 , Create a new sort column on datetime , where you give higher value to the time from 0 to 5 AM

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors