Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I have created a simple list of String using the Create Table in Data pane. I wanted to create a column that shows the row number. I came accros RankX but that sorts using the string and assign a Rank. What I want is the row number should be assigned irrespective of the order of string, similar to the index function in Power Query. I tried to use the Generateseries() function but it shows error that GenerateSeries returns a table. Here is what I have tried :
Created a table that has 30 items. The order of the list has to be based on the given list and not alphabetical.
I tried to add a column using GenerateSeries function
But this gives me an error as GenerateSeries returns a table.
Is it possible to add generateseries value when I create the table in the below method ?
( A table should be returned with Column Name "List" = _List and "Order"= _Order)
I thought a running total might work but was unsuccessful. I created a column with just a value 1 after creating the list and thought I could do sum of all the 1 values upto current row. Couldn't get that to work as Running total uses a Rank which is created by sorting the List string.
Any suggestion on how I could create a table with a list and an order column based on the number of rows in the list ?
Thanks,
Jaco
You could create it using a veeeery long SWITCH expression...
However, if the list is static, I would probably create it in Excel including the index column and copy/paste it into a table using "Enter Data" in the ribbon.
Proud to be a Super User!
Paul on Linkedin.
@JacoMathew
I doubt you can have a number sequence without associating it to an existing column or columns. What stops you from creating a table in Power Query and adding an Index Column.?
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I know it can be done with Power Query. I wanted to know if it can be done from the Data pane. Thought I was missing something simple. Has happened to me in the past. I guess for now, I will move the table creation to Power Query.
I used switch expression for another table but that had only 5 items.
@JacoMathew
Yes, that's the right approach
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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.
| User | Count |
|---|---|
| 45 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 31 | |
| 28 | |
| 24 |