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
harshagraj
Post Partisan
Post Partisan

Day,Hour,Minutes and additional parameters

Hello all i have a below data.

ItemsValueDateTime
Single-Top0.03400693/7/2024 2:28
Single-Top0.03400693/7/2024 4:10
Single-Top0.03400693/7/2024 8:07
Double Top0.53/7/2024 9:16
Double Top0.53/7/2024 9:22
Double Top0.53/7/2024 9:26
PTC103/7/2024 9:40
PTC103/7/2024 9:40
PTC103/7/2024 9:42
PTC103/7/2024 9:57
PTC103/7/2024 10:06
PTC103/7/2024 10:39
PTC103/7/2024 10:47
SDC0.73/7/2024 10:51
SDC0.73/7/2024 11:22
SDC0.73/7/2024 11:31
SDC0.73/7/2024 11:31
SDC0.73/7/2024 12:06
SDC0.73/7/2024 12:27

 

i have plotted a scatter plot on this. Now based on the datetime field i have to create these below parameters like Days, Hours,Minutes etc or like last N miutes, last n hours etc. Basically user needs a button or a dropdown.
@amitchandak  please help if we can do this using a power query. 

3 REPLIES 3
Dangar332
Super User
Super User

hi, @harshagraj 

in power query make a three  custome columns and use below code
for day

Date.Day([date])

 

for hour
Time.Hour([date])

for minute

Time.Minute([date])

 

 

or add below code in your advance editor

 

 #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.Day([date])),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Time.Hour([date])),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.2", each Time.Minute([date]))

 

Dangar332_0-1710143932169.png

 

 

Hi @Dangar332 thanks a lot for your response but i need a parameter or a slicer to be used to represent that datetime in day,hour,minute etc like this. 

harshagraj_0-1710150525987.png

 

hi, @harshagraj 

 

in power bi desktop go to modelling tab > new parameter >select field> drag and drop column of day,minute,hour(which we make in power query) > and select create

 

here column name is different from you 

Dangar332_0-1710151236764.png

 

field parameter interface look like below

Dangar332_1-1710151447998.png

 

 

refer ARTICLE for more about Field parameter

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.