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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.