Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi All,
I'm new to Power BI. I have a stacked graph like this below,
The visual shows the total sales across different countries and the cities acts like stacks. My requirement is to regroup this stack into two categories - Top 5 city sales as one group, and the rest as a separate group.
Example- US consists of cities like NY, LA and many others. I need to group the top 5 cities in the US such as NY, LA and 3 other cities in one group, the other cities that do not fall in the top 5 should be in a separate group named "Others" (Like the below chart). The report should show data for all the countries like this.
I have attached the link to the PBIX for your reference. Thanks to you in advance!
PBIX file link - Download PBIX file here
With regards,
Shriram
Solved! Go to Solution.
Hi, @shriramvbi
You can try the following methods.
Column:
Sales = CALCULATE (Orders[Sales_DAX])
Rank = RANKX('Pseudo Country Table',[Sales])
Category = IF([Rank]<=5,"Top 5 city sales","Other city sales")
Sum sales =
CALCULATE (
SUM ( 'Pseudo Country Table'[Sales] ),
FILTER (
'Pseudo Country Table',
[Category] = EARLIER ( 'Pseudo Country Table'[Category] )
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @shriramvbi
You can try the following methods.
Column:
Sales = CALCULATE (Orders[Sales_DAX])
Rank = RANKX('Pseudo Country Table',[Sales])
Category = IF([Rank]<=5,"Top 5 city sales","Other city sales")
Sum sales =
CALCULATE (
SUM ( 'Pseudo Country Table'[Sales] ),
FILTER (
'Pseudo Country Table',
[Category] = EARLIER ( 'Pseudo Country Table'[Category] )
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!