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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rkapukaya
Helper I
Helper I

Ranking by Different Levels Category in Different Columns Same Visual

I've a table visual display sales and growing percentage (current year vs previous year) by dimensions (Store, manager, supervisor)

 

Store table filters -> fact table (1 to n)

 

In the same visual i want to show rank by sales in all stores, rank by growing within each manager's own stores, rank by growing each supervisor's own stores. I'm stucked with this issue. how can i do that.

 

 

Image_001.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rkapukaya,

I'd like to suggest you take a look at the following blog to know how to use 'if statement' to check the current row contents level, then you can write multiple ranking formulas of different hierarchy levels. (notice: they may not work on the total levels)

Clever Hierarchy Handling in DAX 

Regards,

Xiaoxin Sheng

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

CategoryOutput_1Output_2
A13
A13
A13
B22
B22
C32
C32
A46
A46
A46
A46
A46
A46

Is there any way to get either output_1 or output_2 in columns.

In output_1, I want to rank the categories with different rank every time it appears after break. For e.g., In this case A was ranked 1 initially and after break it was ranked 4. Whereas, in ouput_2, I am trying to calculate the count of A , which should change with every break. Like for, first 3 consecutive As it should count 3 and thereafter for last consecutive A's it should count 6.

rkapukaya
Helper I
Helper I

@amitchandak 
Thanks for your response,

I'm okay with measure calculation. My table has both current year sales and previos year sales. I just calculate growing percentage on powerbi.


I watched your youtube video. it's helpful, yet i want 3 RANK same time in one table visual.
1. Rank : All stores rank by Current year sales. (without any manager or supervisor)
2. Rank : store rank by growing (calc measure) for each manager's own stores.
On my screenshot, Column G shows this. man-1 and man-2, each of them has 4 stores and i ranked them by own stores grown percentage.
3. Rank : store rank by growing (calc measure) for each supervisor's own stores.
on my screenshot, column H show this. Sup-2 and Sup-1, each of them has 2 stores and i ranked them by own stores grown percentage.

According to your youtube and other refer links. they all have just one rank column. I cannot to this.

Anonymous
Not applicable

Hi @rkapukaya,

I'd like to suggest you take a look at the following blog to know how to use 'if statement' to check the current row contents level, then you can write multiple ranking formulas of different hierarchy levels. (notice: they may not work on the total levels)

Clever Hierarchy Handling in DAX 

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@rkapukaya , Not very clear. But you can use time intelligence and date table go get measure like this

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below

 


This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors