The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 |
---|---|
60 | |
55 | |
53 | |
49 | |
30 |
User | Count |
---|---|
179 | |
87 | |
71 | |
48 | |
46 |