Forum Discussion
TOPN dynamic
Hi,
create a parameter and give name as Top N by default select as slicer to page.
Create a Measure to calculate Dynamic Top N on any dimension like, Top N Customers, Top N City etc.
Before this we should create measure from data table here I am using orders table and creating measure for sale as below,
Sales Amount = SUM(Orders[Sales])
Create Top N Customers Measure as below under data table which is orders for now,
TopN Customers =
VAR SelectedTop = SELECTEDVALUE('Top N'[Top N])
RETURN
SWITCH(TRUE(),
SelectedTop = 0, [Sales Amount],
RANKX (
ALLSELECTED( Orders[Customer Name] ),
[Sales Amount],,DESC
)
<= SelectedTop,
[Sales Amount]
)
Result:
- Rfranca7 years agoResolver IV
Anonymous
is not it.
I need to create a table with the top 3 of a Rankx list.
it is not to be changing the amount of rankx.
Review the initial question.thank you;