2
Answers

Get the time total in days hours and minutes in power bi

Photo of Kiran Kumar

Kiran Kumar

Feb 21
188
1

Get the time total in days hours and minutes in power bi

Answers (2)

0
Photo of Jayraj Chhaya
307 6k 97.4k Feb 21

Hi @Kiran,

To calculate the total time in days, hours, and minutes in Power BI, you can utilize DAX (Data Analysis Expressions) to create a measure that formats the total time accordingly. Assuming you have a column with time durations, you can follow these steps:

  1. Create a Measure: Use the following DAX formula to calculate the total time.

    TotalTime = 
    VAR TotalMinutes = SUM('YourTable'[TimeColumn]) * 24 * 60
    VAR Days = INT(TotalMinutes / 1440)
    VAR Hours = INT(MOD(TotalMinutes, 1440) / 60)
    VAR Minutes = MOD(TotalMinutes, 60)
    RETURN 
    FORMAT(Days, "0") & " Days " & FORMAT(Hours, "0") & " Hours " & FORMAT(Minutes, "0") & " Minutes"
    
  2. Replace 'YourTable' and 'TimeColumn': Ensure to replace these placeholders with your actual table and column names.

  3. This measure will provide you with a formatted string that displays the total time in a clear and concise manner, making it easy to interpret the duration in days, hours, and minutes.

Accepted
0
Photo of Eliana Blake
607 1.7k 2.2k Feb 21

Absolutely! "Get the time total in days, hours, and minutes in Power BI" involves calculating the duration in a user-friendly format. In Power BI, you can achieve this by manipulating and formatting time-based data effectively.

To calculate the time total in days, hours, and minutes in Power BI, you can follow these steps:

1. Data Preparation: Ensure that your dataset contains a column with the duration or time-based data that you want to summarize in days, hours, and minutes.

2. Creating Calculated Columns: You can create calculated columns in Power BI to break down the total time into days, hours, and minutes. Here's an example DAX (Data Analysis Expressions) formula for this:


   Days = INT('YourTimeColumn' / 86400)
   Hours = INT(MOD('YourTimeColumn', 86400) / 3600)
   Minutes = INT(MOD(MOD('YourTimeColumn', 86400), 3600) / 60)

Replace `'YourTimeColumn'` with the actual column containing the time data in seconds.

3. Visualization: After creating these calculated columns, you can use them to create visualizations in Power BI that display the total time in a user-friendly format of days, hours, and minutes.

By following these steps and utilizing DAX calculations, you can effectively present the total time duration in days, hours, and minutes within your Power BI reports or dashboards. This approach provides a clear and structured format for users to interpret time-based data efficiently.

If you have a specific dataset or scenario in mind, feel free to provide more details for a more customized example or further assistance.