Search code examples
powerbidaxm

Convert decimal to minutes and seconds using DAX


I have a column that consist values in seconds, I would like to create a visual which displays minutes and seconds. How do I create a measure that shows the decimal in proper seconds.

enter image description here

Or is it better to do this with M language in Power Query?


Solution

  • Use this calculated column

    Minutes & Seconds = 
    VAR minutes = 
        QUOTIENT('Table'[Seconds], 60)
    VAR seconds = 
        MOD('Table'[Seconds], 60)
    RETURN
       FORMAT(minutes, "0#") & ":" & FORMAT(seconds, "0#")
    

    enter image description here