Generating Row Number in Power BI Visualization Using DAX
Vložit
- čas přidán 31. 07. 2024
- I have previously explained how to generate a row-number using Power Query. That method is good for pre-calculating row-numbers in the table. However, sometimes, you want to calculate the row number in a visual, based on something dynamic. That is where DAX comes handy. Let's see how this is possible.
Download the file and study more from my blog article here:
radacad.com/generating-row-nu...
*******************
Want to learn about Power BI or AI? or take your Power BI and AI knowledge to the next level for building reports? Check out our courses in RADACAD Academy for all aspects of Power BI and AI.
RADACAD courses: learn.radacad.com
Become an academy member: learn.radacad.com/academy/
*******************
********
CONNECT with US!
********
-- / radacad_com
-- / rad_reza
-- / leila_etaati
-- / radacad
-- / leila-etaati-b0304636
-- / rezarad
-- / 6393399
-- radacad.com
******** - Věda a technologie
Thank you for the video. I think that in Power BI the row number should be just an built-in option for table or matrix. It is perfectly solved in Data Studio by Google. As a matter of fact the solution with RANKX is not exactly row number, but just rank number - it is noticeable after table sorting.
I strongly believe this would be a built-in option in the future 😊
Hola, alguna solución para que no se muevan de sitio los números de fila?
Reza; Great and simple explanation; Three Cheers!!
Awesome reeza.. Informative indeed.. Thank you...
Thank you so much for sharing.
It's actually more like generating sort ranking. I like it and I really appreciate the explanation of how it works.
it is indeed sort ranking 😊
Many thanks Reza.
Thanks for the video Reza, great content as always, precise and enough details on RANKX. Do you think this will work with calculation groups?
Hi Reza that was really nice I have few questions:
1. Can we pass more than 2 measures?
2.How to generate unique row number here?
Hi Reza,
Related to the first one. I have a use-case where I have both Internet and Retail sales pulled into the grid and I need to update my ranking column according to the measure by which the grid is currently sorted. Basically i need the rank column to be dynamic such that it should show ranking for Internet sales if i sort the table with Internet sales and the same with Retail sales.
Killer tip! Problem with me is, if I change the slicers to show different business groups the RANKX keeps the rank number as if all items are selected. For example Johnny is the #10 overall salesperson, but #1 in Canada. When I apply a filter to show only Canadian salespeople Johnny is at the top but his rank still shows as 10. Any way to fix this?
Replacing ALL with ALLSELECTED works
Yes, I have another video about ALL vs ALLSelected too.
depending on the requirement you may use one or the other
This is very useful video.
Thank you very much.
Would it be possible to modify that measure in order to get correct grand total (equals maximum row number)?
Sure you can, you will need an IF statement that determines if you are in the total row, such as ISFILTERED, and then get the COUNTROWS in that case rather than the row number. I explained here how you can control the total in a DAX expression: czcams.com/video/TP82dLISmgo/video.html
@@RADACAD Thank you very much
I need to generate row numbers for a big list / over 10k, and DAX / PBI doesn't like that, RANKX can't handle it (understandably). You'd think Row Numbers would be really straightforward task :(
Hola pudiste solucionarlo?