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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
GOLEARY735
Frequent Visitor

Data in days and hours in one column.

Hi, 

I have an issue where a data set pulls in any value less than 1 working day (8 hours) in hours rather than days (Last row in the below image).

I can remove the text 'hrs' and 'mins' in my custom column named 'Text.Remove', but then I'm left with data where I can't tell if it's in hours or days.

 

I need to sum up total duration in days in my dashboard. I am hoping that someone knows a solution to this please? I can't find one by searching the internet so far. 

 

GOLEARY735_0-1726660907684.png

Thanks, 

Grace

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @GOLEARY735 

 

You can try the following methods.

Measure = CALCULATE(SUM('Table'[Text.Remove]),FILTER(ALL('Table'),[Unit of Time]="day"))&"day"

vzhangtinmsft_0-1726713373883.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @GOLEARY735 

 

You can try the following methods.

Measure = CALCULATE(SUM('Table'[Text.Remove]),FILTER(ALL('Table'),[Unit of Time]="day"))&"day"

vzhangtinmsft_0-1726713373883.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

bhanu_gautam
Super User
Super User

@GOLEARY735 , Try using below mentioned M code

 

let
// Replace 'YourTable' with your actual table name
Source = YourTable,

// Step 1: Remove 'hrs' and 'mins'
CleanedDuration = Table.AddColumn(Source, "CleanedDuration", each Text.Remove([YourDurationColumn], {"hrs", "mins"})),

// Step 2: Convert hours to days
DurationInDays = Table.AddColumn(CleanedDuration, "DurationInDays", each if Text.Contains([YourDurationColumn], "hrs") then Number.FromText([CleanedDuration]) / 8 else Number.FromText([CleanedDuration])),

// Step 3: Sum up the total duration in days
TotalDurationInDays = List.Sum(DurationInDays[DurationInDays])
in
TotalDurationInDays




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors