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
robstewart89
Advocate IV
Advocate IV

Creating a table for Minutes and Seconds - Looping

Hey, not sure if it's easier in DAX or M to do this but looking to create a list of Minutes and Seconds in the below format:

 

SecondMinute
10
20
30
40
50
11
21
31
41
51
12
22
32
42
52

 

 

Except I want the seconds to run from 1-60 instead of 1-5 and Minutes to run all the way to 90 minutes.

 

Is there a quick way to do this rather than appending lots of queries together or (gasp) doing it in Excel then copying over?

 

Thanks,

Rob

1 ACCEPTED SOLUTION
robstewart89
Advocate IV
Advocate IV

V quickly found a solution...

 

Created a DAX table with GENERATESERIES with the StartValue being any time - TIME(12,00,00) and the EndValue being 1.5 hours after this (to get my 90 mins) and with th increment value being 1 second (TIME(00,00,01)

 

Then Created a calculated column to get me the minutes, where I chose DATEDIFF from the minimum of the time column (created from the above calc table) and the time column to get me 0-90 mins. Then simply created a "SECOND" column to get me the Seconds from the Time column

View solution in original post

2 REPLIES 2
robstewart89
Advocate IV
Advocate IV

V quickly found a solution...

 

Created a DAX table with GENERATESERIES with the StartValue being any time - TIME(12,00,00) and the EndValue being 1.5 hours after this (to get my 90 mins) and with th increment value being 1 second (TIME(00,00,01)

 

Then Created a calculated column to get me the minutes, where I chose DATEDIFF from the minimum of the time column (created from the above calc table) and the time column to get me 0-90 mins. Then simply created a "SECOND" column to get me the Seconds from the Time column

@robstewart89,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
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.