Forum Discussion

WasayAli's avatar
WasayAli
Regular Visitor
3 years ago
Solved

How to Show hours in Power Bi?

Hi,

I have a power bi report that is connected to data sources using a direct query. I have a time column (format hh:mm). I want to know how can I extract and aggregate hours in a way that the slicer only shows hours for selection as shown in the picture below.

 

Also, using this slicer, the visual should is also updated.

 

 

In summary, I want only hours and not minutes (like 1:00, 2:00 ... 24:00), because the user should be able to filter only one day's data.

  • Using Power Query, add a Column using the following, and refer to that column as the value in the slicer:

     

    = Table.AddColumn(#"Changed Type", "Hour", each Time.Hour([Period]), Int64.Type)

     

     

     

2 Replies

  • foodd's avatar
    foodd
    Icon for Community Champion rankCommunity Champion

    Using Power Query, add a Column using the following, and refer to that column as the value in the slicer:

     

    = Table.AddColumn(#"Changed Type", "Hour", each Time.Hour([Period]), Int64.Type)