cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: Custom column Index or Ranking by other column

That's strange.

You would help with a bug-report.

Here's the link to the video on youtube: https://www.youtube.com/watch?v=-3KFZaYImEY

 

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




Super User
Super User

Re: Custom column Index or Ranking by other column

Hi,

 

With data exactly as shown by fedpar in his original post dated 05-07-2016, the following code provided by you is not working

 

let
    Source = Table1,
    Partition = Table.Group(Source, {"Group"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
    #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"Date", "Index"}, {"Date", "Index"})
in
    #"Expanded Partition"

When i paste that code in the New Query window of Power Query, i get an error message

 

Expression.Error: A cyclic reference was encountered during evaluation.

 

Please help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Super User
Super User

Re: Custom column Index or Ranking by other column

Hi @Ashish_Mathur,

it works for me. You might not have applied the code correctly or have other queries in your current file with name conflicts that cause this message. Please have a look at this video - there I've worked with exactly the same data and used the query you've mentioned: https://youtu.be/S9xlq5KUZ60

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




Super User
Super User

Re: Custom column Index or Ranking by other column

Hi,

 

It is working absolutely fine now.  Thank you very much.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
remig Frequent Visitor
Frequent Visitor

Re: Custom column Index or Ranking by other column

Thank you so much @ImkeF, I had lost myself for hours in DAX, to finally realise that I needed to create the index/rank in Query Editor. Your video was awesome, the solution is so simple! 

 

In my case, I had to insert a custom step Table.Sort before to get the right index values. 

javix72 Frequent Visitor
Frequent Visitor

Re: Custom column Index or Ranking by other column

I have used this procedure succefully to obtian rankings based on groups, however, when mergeing with another table to gather detailed information, upon expanding the Table Column, the resulting values get scrambled. Only those generated using the Group and Index procedure... Could it be a Power Query Bug?

javix72 Frequent Visitor
Frequent Visitor

Re: Custom column Index or Ranking by other column

I have used this procedure succefully to obtian rankings based on groups, however, when mergeing with another table to gather detailed information, upon expanding the Table Column, the resulting values get scrambled. Only those generated using the Group and Index procedure... Could it be a Power Query Bug?

Super User
Super User

Re: Custom column Index or Ranking by other column

It might help if you buffer the group-step (Table.Buffer).

Otherwise I would need more detailled information of how the scramble looks like/what exactly is the problem.

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




javix72 Frequent Visitor
Frequent Visitor

Re: Custom column Index or Ranking by other column

Thank you so much! It worked fine. After using the Table.Buffer it worked perectly...!

Anthony007 Regular Visitor
Regular Visitor

Re: Custom column Index or Ranking by other column

Hi @ImkeF! Can u help please with this example. We have a table with three columns. Need to build a rating (or index) given the week and the value

 

table.jpg

Need:

table2.jpg

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors