March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Friends,
I would like to achieve this. Is this possible with DAX? I would like to put a row number for each occurence of the column 1. Thank you in advance!
Solved! Go to Solution.
Hey @JofrainVisda ,
I think you can achieve this if you are able to add a column to your table that acts as a ro identifier:
Then you can add the below DAX to create the column you are looking for:
Column =
ROWNUMBER(
SUMMARIZE(
ALLSELECTED( 'Table')
, 'Table'[item]
, 'Table'[rowindex]
)
, ORDERBY( 'Table'[rowindex])
, DEFAULT
, PARTITIONBY( 'Table'[item] )
)
RANKX will not work because of
Hopefully, this helps to tackle your challenge.
Regards,
Tom
Hi bro,
Thank you for your answer but Tom Martens is correct. I did not get the correct output. Appreciate you man
Hey @JofrainVisda ,
I think you can achieve this if you are able to add a column to your table that acts as a ro identifier:
Then you can add the below DAX to create the column you are looking for:
Column =
ROWNUMBER(
SUMMARIZE(
ALLSELECTED( 'Table')
, 'Table'[item]
, 'Table'[rowindex]
)
, ORDERBY( 'Table'[rowindex])
, DEFAULT
, PARTITIONBY( 'Table'[item] )
)
RANKX will not work because of
Hopefully, this helps to tackle your challenge.
Regards,
Tom
Thank you Tom! Your solution worked. I will accept this as the solutions.
Could I also add a parameter in this solution? like if I have a column 2 and it has a value of 1 and 2. So what I want to add is to count the sequence of Column 1 who's Column 2 is equal to 1. Then another sequence for Column 2 is equal to 2.
Hey @JofrainVisda ,
I have to admit that I have no idea what your requirement is and please open a thread.
Regards,
Tom
Yes, you can achieve this using DAX (Data Analysis Expressions) in Power BI or other tools that support DAX. You can use the RANKX function to assign a row number to each occurrence of values in Column 1. Here's a sample DAX expression you can use:
Row Number =
RANKX(
ALL('YourTableName'[Column1]), // Replace 'YourTableName' with the name of your table and 'Column1' with the name of your column
'YourTableName'[Column1], // Replace 'YourTableName' with the name of your table and 'Column1' with the name of your column
, ,
ASC,
Dense
)
This DAX expression will generate a row number for each occurrence of values in 'Column1'. Replace 'YourTableName' with the actual name of your table and 'Column1' with the name of your column.
You can add this DAX expression as a new calculated column in your Power BI table or use it in a measure, depending on your requirements.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
78 | |
67 | |
52 |
User | Count |
---|---|
199 | |
140 | |
96 | |
77 | |
68 |