Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Varela
Frequent Visitor

Round down stopped working

the dax below was working fine yesterday, today it is not anymore, don't know what happened

 

Md. Real Resolucao =
VAR Duration =
AVERAGE (Tickets2016[Tempo Real Resolucao - Segundos])
VAR Hours =
ROUNDDOWN ( Duration / 3600, 0 )
VAR Minutes =
ROUNDDOWN ( ( Duration - ( Hours * 3600 ) ) / 60, 0 )
VAR Seconds =
MOD ( Duration - ( Hours * 3600 ), 60 )
VAR H =
IF ( LEN ( Hours ) = 1,
CONCATENATE ( "0", Hours ),
CONCATENATE ( "", Hours )
)
VAR M =
IF (
LEN ( Minutes ) = 1,
CONCATENATE ( "0", Minutes ),
CONCATENATE ( "", Minutes )
)
VAR S =
INT(IF (
LEN ( Seconds ) = 1,
CONCATENATE ( "0", Seconds ),
CONCATENATE ( "", Seconds )
))
RETURN
CONCATENATE (
H,
CONCATENATE ( ":", CONCATENATE ( M, CONCATENATE ( ":", S ) ) )
)

1 ACCEPTED SOLUTION
KHorseman
Community Champion
Community Champion

You have substituted periods for commas in almost every VAR statement.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
KHorseman
Community Champion
Community Champion

Can you be more specific? In what way is it not working?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




it says there is sintax errors.

KHorseman
Community Champion
Community Champion

I'm not getting any error messages when I copy your formula into my test data. Works just fine. Are you sure you haven't accidentally deleted a comma or a parentheses somewhere when you tried to enter it? What exactly does the syntax error message say?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




the sintax '0' is incorrect. (DAX(VAR Duration = AVERAGE (Tickets2016[Primeira Resposta Duracao Segundos])VAR Hours = ROUNDDOWN ( Duration / 3600. 0 )VAR Minutes = ROUNDDOWN ( ( Duration - ( Hours * 3600 ) ) / 60. 0 )VAR Seconds = MOD ( Duration - ( Hours * 3600 ), 60 )VAR H = IF ( LEN ( Hours ) = 1. CONCATENATE ( "0", Hours ), CONCATENATE ( "", Hours ) )VAR M = IF ( LEN ( Minutes ) = 1. CONCATENATE ( "0", Minutes ), CONCATENATE ( "", Minutes ) )VAR S = INT(IF ( LEN ( Seconds ) = 1. CONCATENATE ( "0", Seconds ), CONCATENATE ( "", Seconds ) ))RETURN CONCATENATE ( H, CONCATENATE ( ":", CONCATENATE ( M, CONCATENATE ( ":", S ) ) ) ))).

KHorseman
Community Champion
Community Champion

You have substituted periods for commas in almost every VAR statement.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




That's what happend, had to change my pc settings to make a software work, good call. thanks

Varela
Frequent Visitor

If i fix the "0" on rounddown it says that concatenate is wrong now

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.