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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.