Forum Discussion
TOPN
Hi,
Try this
- Create a measure to harvest the value chosen in the slicer: Measure1 = MIN(Topn[Value])
- Create a messure to calculate Total dues. Total dues = SUM(Table1[Dues])
- Modify your measure to Table2 = TOPN([Measure1],Table1,[Total dues],DESC)
Does this work?
Hi Ashish and All,
No I tried this and will never work. Varaibles , measures etc.
However i was able t find a workaround without creating table 2 at all.
0- Table1 has only 2 columns GA & total Dues(Which I created a measure mTotal_Dues for it
1- I created a measure mRANK = RANKX(ALL(table1),[mTotal_Dues],,DESC) in Table1
2- I created another measure mSelTopNNumber = INT(SELECTEDVALUE('Ranking Selection'[Rank])) still in Table 1 to get the selected value form my slicer 3,5,7,10 "The Slicer Table has only one cloumn Rank with 3,5,7,10 as values
3-I created a 3rd measure check = IF([mRANK]<=[mSelTopNNumber],1,0) still in Table1 to test the rank of each row against the selected value in the slicer to Check measure in the Visual Filter and set its value to 1,0
Now, every time I choose a value from the slicer, 3,5,7,10 my visual diplays only the n number of rows that meets the visual filter with value1 ...meaning if I selected 5 in the slicer, Visual diplays only 5 rows ranked corretly etc , selecting 7 visual diplays 7 rows and so on,
I get rid of TOPN that seems static, meaning I can supply a number only in the n_Value paramter not any measure or variable which provide static visual , but not dynamic visual at all.
If an expert has an alternative to get TOPN to allow dynamic value in n_value parameter, please proivde a way for this.
BR
Maghed
- ImkeF7 years ago
Community Champion
This is newest dynamic TOPN-approach: https://blog.gbrueckl.at/2019/05/power-bi-dynamic-topn-others-with-drill-down/