Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
76 | |
47 | |
45 | |
32 |
User | Count |
---|---|
172 | |
90 | |
66 | |
46 | |
45 |