Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |