March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello all,
So my data source is giving a duration in the form of
4 hours 5 minutes
1 day 2 hours 1 minute
56 minutes
I was wondering how this could be transformed into a minutes only result, since i can have days, hours or minutes, I guess it can be done with Dax.
No, the data source can't be changed, at least not in time for some dashboards we need out.
Any idea on how to make this work??
Thanks in advance.
Solved! Go to Solution.
Hi @ronniealfaro,
You can achieve this via Power Query. Please add custom columns in Query Editor mode.
=if Text.PositionOf([Column1],"day") <0 then 0 else Number.FromText(Text.Start([Column1], Text.PositionOf([Column1],"day"))) =if Text.PositionOf([Column1],"hours") <0 then 0 else Number.FromText(Text.End(Text.Trim(Text.Start([Column1], Text.PositionOf([Column1],"hours"))),2)) =if Text.PositionOf([Column1],"minutes")<0 then 0 else Number.FromText(Text.End(Text.Trim(Text.Start([Column1], Text.PositionOf([Column1],"minutes"))),2)) =[day value]*24*60+[hour value]*60+[minute value]
Best regards,
Yuliana Gu
Hi @ronniealfaro,
You can achieve this via Power Query. Please add custom columns in Query Editor mode.
=if Text.PositionOf([Column1],"day") <0 then 0 else Number.FromText(Text.Start([Column1], Text.PositionOf([Column1],"day"))) =if Text.PositionOf([Column1],"hours") <0 then 0 else Number.FromText(Text.End(Text.Trim(Text.Start([Column1], Text.PositionOf([Column1],"hours"))),2)) =if Text.PositionOf([Column1],"minutes")<0 then 0 else Number.FromText(Text.End(Text.Trim(Text.Start([Column1], Text.PositionOf([Column1],"minutes"))),2)) =[day value]*24*60+[hour value]*60+[minute value]
Best regards,
Yuliana Gu
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
74 | |
59 | |
53 |
User | Count |
---|---|
196 | |
121 | |
108 | |
68 | |
65 |