Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I need to add to my table view a row_number column which needs to reset based on the selection. For example, if I select the territory Canada, I need to have row_numbe from 1 to 100 let's say, if I change the selection to US I need to have 1 to 50.
I have tried the solution from the community with adding an index and creating a measure:
Row_Number =
CALCULATE (
COUNTROWS(table),
FILTER ( ALLSELECTED (table ), table[Index] <= MAX ( table[Index]) )
) but the result is not the desired one ( I get 4, 8, 11, 14...). I have also filters applied in the Filter Pane from the right..
Thank you.
@Anonymous - Sample data would help, but maybe the Mythical DAX Index? https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/m-p/1093214#M528
Or maybe something dealing with RANKX? https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452
Or maybe Cthulhu? https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/m-p/509739#M211
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Hello @Greg_Deckler , I am trying to achieve what is described here, I am using the exact same functions but my row number column has the value 1 for all rows.
@Anonymous - I don't have an example of what your data looks like, but I mocked something up. See what you think. PBIX is attached below sig, Table 12, Measure 12, Page 12.
Hello @Greg_Deckler , thank you for your example. I have checked my data set and it includes a Date column, which is the lowest level of detail for the data. In my report I do not display this column because I make LTD calculations. If I add this column in the data table the row number is calculated correctly:
but if I remove that column then the numbers will be displayed incorrectly.
Is there any way of calculating the correct index only for the data displayed? Thank you.
@Anonymous , try if rank can help
I logged idea for that : Serial No in Visual Table
https://ideas.powerbi.com/ideas/idea/?ideaid=80612ec5-14a9-4929-a2ee-531943fa51d4
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |