SECOND

SECOND

How to Use the Power BI DAX function SECOND

Syntax of the SECOND Function

The syntax of the Power BI DAX function SECOND is as follows:


SECOND(time)


In this syntax, the 'time' argument is the time value that you want to extract the second value from. The 'time' argument must be in a valid time format, such as 'hh:mm:ss'.

Examples of the SECOND Function

Let's take a look at some examples of how to use the Power BI DAX function SECOND.

Example 1

Suppose you have a column in your data that contains time values. You want to extract the second value from each time value and create a new column with the second values. Here's how you can do it using the SECOND function:


=SECOND([time column])


In this example, replace '[time column]' with the name of the column that contains the time values.

Example 2

Suppose you have a table that contains sales data for a store. You want to calculate the average sales per second for each day of the week. Here's how you can do it using the SECOND function:


=AVERAGEX(

FILTER(

‘sales’,

WEEKDAY(‘sales'[date])=1

),

SECOND(‘sales'[time])

)


In this example, we're using the AVERAGEX function to calculate the average sales per second for each day of the week. The FILTER function is used to filter the sales data for Monday (represented by the number 1). Finally, we're using the SECOND function to extract the second value from the time column.

The Power BI DAX function SECOND is a handy tool for extracting specific parts of time values in your data. By using this function, you can analyze your data in more detail and gain deeper insights into your business operations. We hope this article has provided you with a better understanding of how to use the SECOND function in Power BI.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

Subject

Your Name (required)

Company/Organisation

Email (required)

Telephone

Training Course(s)

Your Message

Upload Example Document(s) (Zip multiple files)

Copyright, G Com Solutions Ltd, 2024.
Tower Bridge Business Centre, 46-48 East Smithfield, London E1W 1AW
0800 998 9248   |   9:00 a.m. till 5:30 p.m.

Connect With Me: