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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Converting Tableau Calculation to Power BI

Hi

I have this column in a tableau dashboard that I built and I was wondering how I convert the data in the same way. I am trying it through the custom column in Power Bi. My calculation in Tableau was

STR(INT(SUM([Total Display Time])/86400))

+ " Days, " +

IF (INT(SUM([Total Display Time])%86400/3600))

< 10 THEN "0" ELSE "" END + STR(INT(SUM([Total Display Time])%86400/3600))

+ " Hours, " +

IF INT(SUM([Total Display Time])%3600/60)

< 10 THEN "0" ELSE "" END + STR(INT(SUM([Total Display Time])%3600/60))

+ " Minutes, " +

IF INT(SUM([Total Display Time]) %3600 %60)

< 10 THEN "0" ELSE "" END + STR(INT(SUM([Total Display Time]) %3600 %60))

+ " Seconds "

 

Could someone possibly help me convert this to a Power BI to end with the same results?

 

TIA

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

 

Try create this using dax with calculate column:

 

CONCATENATE(SUM([Total Display Time])/86400,
CONCATENATE("Days"
CONCATENATE(IF(SUM([Total Display Time])/86400/3600<10,"0",""),
CONCATENATE("Hours",
CONCATENATE(IF(SUM([Total Display Time])/3600/60<10,"0",""),
CONCATENATE("Minutes",
CONCATENATE(IF(SUM([Total Display Time])/3600/60<10,"0",""),
CONCATENATE(SUM([Total Display Time]) /3600/60), "Seconds"))))))))
 
 
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 

 

Try create this using dax with calculate column:

 

CONCATENATE(SUM([Total Display Time])/86400,
CONCATENATE("Days"
CONCATENATE(IF(SUM([Total Display Time])/86400/3600<10,"0",""),
CONCATENATE("Hours",
CONCATENATE(IF(SUM([Total Display Time])/3600/60<10,"0",""),
CONCATENATE("Minutes",
CONCATENATE(IF(SUM([Total Display Time])/3600/60<10,"0",""),
CONCATENATE(SUM([Total Display Time]) /3600/60), "Seconds"))))))))
 
 
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , In power query

 

Duration(Number.IntegerDivide(Number.FromText([Cycle:duration]),86400) ,Number.IntegerDivide(Number.Mod(Number.FromText([Cycle:duration]),86400),3600),
Number.IntegerDivide(Number.Mod(Number.Mod(Number.FromText([Cycle:duration]),86400),3600),60),
Number.Mod(Number.Mod(Number.Mod(Number.FromText([Cycle:duration]),86400),3600),60)
)

 

DAX  - Measure or column both will work
Quotient([Total Display Time],86400) & ":" Quotient(mod([Total Display Time],86400),3600) &":" & Quotient(mod(mod([Total Display Time],86400),3600),60) &":" & mod(mod(mod([Total Display Time],86400),3600),60)

Anonymous
Not applicable

Unfortunately this didn't work in my custom column am I doing something wrong?

 

Thanks

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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