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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
masifmalik
New Member

Need Help plotting stack graph with seconds converted into Hrs per week.

Hello - i have data in seconds format - which is in whole number. How to i convert it in to Hrs and show it in stacked bar graph by weeks. I have perday data by seconds which i have sorted in weeks.

 

i currenlty used below to convert to Hrs but i am not able to graph it. below is in Text format output.

HH:MM TotalTime =
VAR TotalSeconds = SUM(Merge1[Total Time])  // Replace 'YourTableName' with the name of your table
VAR Hours = INT(TotalSeconds / 3600)
VAR Minutes = INT(MOD(TotalSeconds - (Hours * 3600), 3600) / 60)
RETURN
    FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00")
1 REPLY 1
Anonymous
Not applicable

Hi @masifmalik ,
Based on the information you provided, the measure you wrote will convert seconds to HH:MM text format, which is not ideal for creating stacked bars.
You can add the measure in Value:

 

 

vyifanwmsft_2-1709174865279.png

 

Final output:

vyifanwmsft_1-1709174744457.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.