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 everyone!
I have a situation with the RANKX function, I need to condition a field so that the top 5 positions in the list are >- than 6, the formula I currently use is RANKX(ALL('Customer'[Nombre_Cliente]); sum('Customer'[promedio_viaje] >-6))
I look for this feature to return a top 5 with customers with travel averages of 6 (averages are calculated in the table).
This measure does not present me with any data, I would like to know if there are alternatives.
Thanks in advance.
Solved! Go to Solution.
Hi, @Syndicate_Admin
According to your description, you want to get the top 5 positions in the list are more than 6, you can try my steps:
This is the test data I created based on your DAX formula:
Rank =
var _rank=
RANKX(
FILTER(ALL(Customer),[promedio_viaje]>=6),
[promedio_viaje],, DESC,Dense)
return
IF([promedio_viaje]<6,BLANK(),_rank)
The calculated column displayed like this in the table:
And you can get what you want.
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Syndicate_Admin
According to your description, you want to get the top 5 positions in the list are more than 6, you can try my steps:
This is the test data I created based on your DAX formula:
Rank =
var _rank=
RANKX(
FILTER(ALL(Customer),[promedio_viaje]>=6),
[promedio_viaje],, DESC,Dense)
return
IF([promedio_viaje]<6,BLANK(),_rank)
The calculated column displayed like this in the table:
And you can get what you want.
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
There might be a better way to do it, however try the below appraoch:
Create a DAX table with the below formula:
Top5 = TOPN(5,TOPN
(5,
SUMMARIZE(
TableName
,TableName[Column],"ColumnName", Average(TableName[Column])
),"ColumnName",DESC))
I hope this works
this article is quite useful to understand your options. there are several ways you can do this
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
Proud to be a Super User!
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 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |