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.
Looks like power query M is a complete different beast from DAX. But I'm trying to create a new column in power query editor because i've been told it's generally better to add there then with DAX. So I have a column of whole numbers that represent Hours of the day (0-23). I'm trying to add a new column to convert that to 12 hour format ( 0 = 12:00AM, 13 = 1:00PM etc). Thanks.
Solved! Go to Solution.
@wpf_ - Not sure who told you that, but it's perhaps true up until the point that it takes 10 times longer to do something than to just do it the way that you know how to do it. But, understood there are some Power Query bigots out there to be sure. But, after all, it ends up being a column in the data model regardless so it's not like it is the end of the world if you do in DAX or Power Query. Anway, you could do it like this in Power Query:
Time.FromText([Hour] & ":00:00")
Make sure your Hour column is text or you can convert it using Text.From
@wpf_ - Not sure who told you that, but it's perhaps true up until the point that it takes 10 times longer to do something than to just do it the way that you know how to do it. But, understood there are some Power Query bigots out there to be sure. But, after all, it ends up being a column in the data model regardless so it's not like it is the end of the world if you do in DAX or Power Query. Anway, you could do it like this in Power Query:
Time.FromText([Hour] & ":00:00")
Make sure your Hour column is text or you can convert it using Text.From
Awesome that worked!
Yea I was told by one of the guys on here that power query does a better job of compressing the data. But it's good to hear that not everyone is on board with that. I'm already having a hard time wrapping my head around dax, and now M. : )
@wpf_ - Well, there is one guy in particular but I won't name names. Anyway, in that case, compression has nothing to do with Powre Query or DAX. Compression is in the Vertipaq engine. So, as you can see in the attached PBIX files, 1 was created all in Power Query and 2 was created all in DAX. 2 is actually a tiny amount smaller than 1 so whatever that guy was preaching is bogus IMHO. There are other reasons why you might want to use Power Query over DAX but compression has nothing to do with any of that.
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |