Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Luis_Gomez
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:

 

Luis_Gomez_0-1675873013649.png

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:

 

Luis_Gomez_1-1675873642600.png

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

 

Luis_Gomez_2-1675873868703.png

 

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

 

1 REPLY 1
Anonymous
Not applicable

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

How to Get Your Question Answered Quickly

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.