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
Will adding an index in power query and ordering it by index in ascending order there ensure that the same order will be maintained in the data view as well in Power BI?
I have the data table below and would like to group the data by each object_id first and then for each of these ids I would like to group the data as per the state from the end of the '0' to next '0' in descending order of state_time. For example in the table below 6:18 to 6:19 should be grouped into a single id. I had put an index in the power query initially after sorting object_id and state_time in descending order. Then added a calculated column in the data view. The DAX is given below. Just wanted to check if the sort order from Power Query to Data view will be maintained. The DAX below actually works but I just wanted to make sure it i accurate and will work always since it is dependend on teh index number. Thansk in advance :).
Hi @Vivek2456,
I have a question. Will you be using the grouped table in the creation of measures and is this the table that you are looking for?
If yes, then for the sake of performance, I would suggest you to do the same data transformation in Power Query using the Group By functions and taking the Max of state_time column as per your requirement.
I have not used the index column, and instead added a date column, and did a Group By based on that.
I am attaching my PBIX for your reference and please provide some more information if the solution is not what you are looking for.
To answer you other question, the data view will not necessarily maintain the sort order but you can always sort by any column, which is why when it comes to transformation, Power Query is better than DAX.
Hope this helps and apologies if I have not understood the problem correctly.
Thank you,
Vishesh Jain
Proud to be a Super User!
Thanks. I actually found a solution. But now the scope had changed. Please see below. Apologies for late response.
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 |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |