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
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
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.