Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello All,
How can we create a index calculated column or measure using DAX, like we do in power query.
Any help.
Mohan V
Solved! Go to Solution.
Hi @Anonymous,
What does your data source look like? I create the following sample table and get expected result.sample table
I create measure using the formula below.
Index = RANKX(ALL(Test),FIRSTNONBLANK(Test[Project ID],Test[Project ID]),,ASC,Dense)
Then create a table, select the Project ID and measure as the value level, you will get expected result as follows.
Best Regards,
Angelia
Hi @Anonymous,
have you tried to use the RANKX() function. This calculates a ranking depending on a value. So you should be able to generate an index column with it.
Greetings
spuder
@Anonymouswhat is the sort order of your table and does it has duplicate values in the sorted columns?
@Anonymous
then it should be working with RANKX()
@spuder I just tried this.
But i got the output which i am not expecting.
I would like to get the no of rows that i will be having in that table dynamically,
like in that above image i should get as 1
2
3
4
5
Values.
Any help
Hi @Anonymous,
What does your data source look like? I create the following sample table and get expected result.sample table
I create measure using the formula below.
Index = RANKX(ALL(Test),FIRSTNONBLANK(Test[Project ID],Test[Project ID]),,ASC,Dense)
Then create a table, select the Project ID and measure as the value level, you will get expected result as follows.
Best Regards,
Angelia
You can't rely on RANKX when adding Index as RANKX generates same index for the similar target column values.
OK. But as far as I can see. You don't want to index a source table but a table visual, right? And the table visual does not include all Project IDs, right? Then it won't work that way. Because you always rank against the source table with ALL Project IDs.
So I don't see a solution to get this problem working. Sorry.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |