cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

Showing rank results as columns

Hi,

I am developing a report, here are the specifics:

Rank top 5 brands by territory based on a formula, the report must look like this:

The ranking must be in columns "Marca_1" and "_Rank_Presencia_1" for Top 1 and so on up to Top 5.

I am using the following formula to calculate "Marca_1" which gives me the name of the brand on the Top 1, the formula repeats up to 5

_Rank_Presencia_Marca_1 =
var test = IF( HASONEVALUE('Ventas'[Marca]) && [_%_Presencia_por_Marca]>0,
Var Result = RANKX(ALL(Ventas[Marca]),[_%_Presencia_por_Marca])

Return
Result)
Return
IF(test=1, MAX(Ventas[Marca]),BLANK())

And the formula for the value is:

_Rank_Presencia_1 =
var test = IF( HASONEVALUE('Ventas'[Marca]) && [_%_Presencia_por_Marca]>0,
Var Result = RANKX(ALL(Ventas[Marca]),[_%_Presencia_por_Marca])

Return
Result)
Return
IF(test=1, [_%_Presencia_por_Marca],BLANK())

Same here, a formula for Top 1 up to Top 5

Now, displaying the results on a Table visual, the most I can get is up to here:

There is a visual filter that limits te report to the Top 5,

I have to put Brand as a column in order to calculate correctly, all calculations are correct but I cannot find a way to format the report as has been requested.

Any suggestions will be kindly appreciated.

Regards

Luis Gómez

Community Support

Hi @Luis_Gomez ,

How did you set your visual? In order to get a better understanding on your problem and give you a suitable solution, could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors