Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
My input data looks like the right column and power bi recognizes in the following format(text). There are some duration values greater than 24 hours. I am unable to change data type to duration and then to total seconds(throws error). Can someone write a power query code to create a new column which has the total seconds( for eg., 24*3600+53) when power bi doesn't recognizes that I have more than 24 hours and takes only the remainder hours and minutes.
You can add a custom column with this expression to get total seconds.
let
parsedlist = List.Transform(Text.Split([Duration], ":"), each Number.From(_) )
in
parsedlist{0}*3600 + parsedlist{1} + parsedlist{2}/100
Pat
Actually the problem is that the data is imported from an excel where it uses the format(1/1/1900) to store time more than 24 hours and power query recognizes this as shown above. Can you calculate total seconds from this type.
That should be easier. Just convert it to a DateTime type first, then convert it to a decimal and, when prompted, choose "Add as a new step". This will give your duration in days, and you can do a multiply transform to convert it to seconds. Or you can leave it as decimal in days, and just multiply to get seconds in your measures.
Pat
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |