Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi
On my Power BI report, I have a visual table that fetches columns from several tables.
And I'd like to create an index in this visual but I don't know how to do it?
Does anyone have a solution?
Best regards
Solved! Go to Solution.
@Charline_74 , You can create a column or measure using RANKX function
For calculated column
Index = RANKX(ALL('Sales'), 'Sales'[OrderDate], , ASC, DENSE)
For measure
IndexMeasure =
VAR CurrentRow = MAX('Sales'[OrderDate])
RETURN
RANKX(ALL('Sales'), 'Sales'[OrderDate], CurrentRow, ASC, DENSE)
Proud to be a Super User! |
|
Hi, @Charline_74 If you don't have column with unique values, and have multiple columns in the table, then you can use rownumber function to create index column with a combination of all the columns in your table. For example,
@bhanu_gautam & @manvishah17
how do I do this when none of my columns contains unique data?
Here's the result I got :
You can merge two column using concat and create some unique values if possible in your table
Proud to be a Super User! |
|
@Charline_74 , You can create a column or measure using RANKX function
For calculated column
Index = RANKX(ALL('Sales'), 'Sales'[OrderDate], , ASC, DENSE)
For measure
IndexMeasure =
VAR CurrentRow = MAX('Sales'[OrderDate])
RETURN
RANKX(ALL('Sales'), 'Sales'[OrderDate], CurrentRow, ASC, DENSE)
Proud to be a Super User! |
|
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
42 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |