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
SK87
Helper III
Helper III

Create a stacked bar chart on Top 5 Categories

@tamerj1 

 

Hi All,

I have a problem, kindly help me to resolve the same:

I have dataset from 2018 till now. But need to create a graph where we show the bars of Past 12 months on the filter selection of Month'Year. and need to show Top 5 categories and rest in Others based on latest month.

That is : if I select "June'2022" in slicer then I should see bars from July'21-June'22 and that should show values of latest top 5 categories along with Other option (in which rest of the value counts are stored , 6th option)

 

I have 48 unique categories and count of these categories should be ranked as 1st 5 and then rest count should be in others.

 

I am sharing sample data:

Date Categories
2022-01-01 STB
2022-01-01 SB
2022-01-01 SB
2022-01-01 P
2022-01-01 SB
2022-03-01 SB
2022-03-01 DB
2022-03-01 LD
2022-03-01 P
2022-03-01 EC
2022-03-01 P
2022-03-01 EC
2022-03-01 RB
2022-03-01 P
2022-04-01 P
2022-04-01 EC
2022-04-01 CC
2022-04-01 SB
2022-04-01 BT
2022-04-01 SB
2022-04-01 EC
2022-04-01 SB
2022-05-01 SB
2022-05-01 SB
2022-05-01 P
2022-05-01 CV
2022-05-01 CV
2022-05-01 P
2022-05-01 CC
2022-05-01 CC
2022-06-01 ROB
2022-06-01 SB
2022-06-01 Other/Specialty
2022-06-01 CC
2022-06-01 P
2022-06-01 CC
2022-06-01 P
2022-06-01 CC
2022-06-01 FT
2021-07-01 STB
2021-07-01 LD
2021-07-01 FT
2021-07-01 SB
2021-07-01 CV
2021-07-01 FT
2021-07-01 FT
2021-07-01 CC
2021-08-01 ROB
2021-08-01 BT
2021-08-01 SB
2021-08-01 P
2021-08-01 SB
2021-08-01 ROB
2021-08-01 P
2021-08-01 SB
2021-09-01 SB
2021-09-01 P
2021-09-01 SSS
2021-09-01 SB
2021-09-01 BT
2021-09-01 P
2021-10-01 P
2021-10-01 EC
2021-10-01 DB
2021-10-01 P
2021-10-01 STB
2021-10-01 SSS
2021-10-01 LD
2021-11-01 DB
2021-11-01 P
2021-11-01 BT
2021-11-01 CC
2021-11-01 RB
2021-11-01 CC
2021-11-01 SB
2021-11-01 EC
2021-12-01 P
2021-12-01 BT
2021-12-01 SB
2021-12-01 SB
2021-12-01 P
2021-12-01 RB
2021-12-01 P
2021-12-01 SSS
2021-12-01 P
2021-12-01 BT
2021-12-01 FT
2021-12-01 FT
2021-12-01 SB
2021-12-01 SSS
2021-12-01 P
2021-12-01 CC
2021-12-01 EC
2021-12-01 BT
2021-12-01 CV
2021-12-01 BT
2021-12-01 SB
2021-12-01 MB
2021-12-01 CC
2021-12-01 BT
2021-12-01 ST
2021-12-01 FT

 

Please suggest.

5 REPLIES 5
v-cazheng-msft
Community Support
Community Support

Hi @SK87,

 

We noticed that your issue has been resolved. Could you please share your solutions and mark it as the solution by Accept as Solution if it is convenient for you? It will help others who may encounter similar issues. Thanks in advance!

 

Best Regards,

Community Support Team _ Caiyun

SK87
Helper III
Helper III

@tamerj1 

 

Ranking should be based on total value of the current month (latest).

Yes, we are talking about count only, number of times this category is appearing.

Need to return P12M based on the filter/slicer selection of Month'YY.

@SK87 
Ok, let me see what can I do. Perhaps at weekend I'll have some time to look into it. FYI this is a project not a task and is complex too.

I have achieved the desired output. 

Have a great weekend! @tamerj1 

tamerj1
Super User
Super User

@SK87 
OMG! this is all in one question 😅.
The ranking should be based on the total value of the 12 months right? We are talking about count (number of) appearance right?

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.