Forum Discussion
RANKX on selected field parameter
- 3 years ago
Hi, nhniniras
Are you referring to this kind of ‘Field-parameters’ ?
Currently, PowerBI does not support direct use of field parameters in measure.
Best Regards,
Community Support Team _ Eason - Anonymous3 years ago
Hello nhniniras ,
I was also looking a solution for this in the web, and then I realized that "field parameter" is only for Power Bi to understand it, but at the end is about the columns you have included in your fields.
So what I did is to created a measure with an if statement according to the Order of my fields names and is working perfectly (I used the measure to show a specific number of customers in a visual according to a slicer, hence the switch true):
IF(SELECTEDVALUE(localCustomers[localCustomers Order]) = 0,SWITCH(TRUE(),RANKX(ALLSELECTED('Dim Customer'[LOCAL_CUSTOMER_NAME]),[businessMetricCP],,,Dense) <= SelectedTop,1),SWITCH(TRUE(),RANKX(ALLSELECTED('Dim Customer'[CUSTOMER_KEY]),[businessMetricCP],,,Dense) <= SelectedTop,1))Hope can help others with the same doubts.
Hello nhniniras ,
I was also looking a solution for this in the web, and then I realized that "field parameter" is only for Power Bi to understand it, but at the end is about the columns you have included in your fields.
So what I did is to created a measure with an if statement according to the Order of my fields names and is working perfectly (I used the measure to show a specific number of customers in a visual according to a slicer, hence the switch true):
Hi and sorry for my late respons, but thank you very much.
I think we more or less ended up with the same solution with some IF and Swithc functions 🙂
In my solution I ended up writing a bunch of measures and used the Switch function to find the "parameter" measure the user wants create a Top X on.