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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
klaraklara
Frequent Visitor

Create segments based on article ranking

Hello!

I have three different tables with relationship to eachother in PBI
SALES: Articles (article_id), Net Sales and date_id (and more)
DIM_product: Artcile (article_id) specific attributes
Dim_Calender: date_id, weeks, months, year etc. 

I want to create a visulatization loking like this:

klaraklara_0-1715689612320.png


So I want to create a ranking of my articles based on their sales in the given time period that I filter on. Then I want to group together the top 20 best selling articles into segment "Top 20" and so on. 

In my current solutuion I do not manage to create segments that updates depending on time filter - they are fixed with no time filter so I cannot use them with dim_calender. 

How can I solve my problem?

All best,
Klara




1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @klaraklara

 

Please try the following steps:

 

Step 1: Create a Ranking Measure

First, you need to create a measure that ranks your articles based on net sales. This measure will dynamically update as filters are applied.

Article Rank = RANKX(ALL('SALES'[Articles]), CALCULATE(SUM('SALES'[Net Sales])), , DESC, Dense)

 

Step 2: Create a Segmentation Measure

Next, create a measure to segment your articles based on their ranking.

Article Segment = 
VAR ArticleRank = [Article Rank]
RETURN
    SWITCH(TRUE(),
        ArticleRank <= 20, "Top 20",
        ArticleRank <= 40, "21-40",
        ArticleRank <= 60, "41-60",
        "Other"
    )


Step 3: Use the Segmentation in Visualizations.









Best Regards,
Jayleny
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

Hi @Anonymous and thank you for replying!

These measures works correctly. The problem is the visualization. If creating a matrix table I cannot place "Article Segment" in rows since it is a measure and not a column. So I can't group all values in 1-20 segments together and reach my goal visualization I shared.

How do I solve that?

Anonymous
Not applicable

Hi @klaraklara 

 

If the matrix is not your only option, you can try using other visual objects to present your data more intuitively.

 

 

 

 

 

Best Regards,

Jayleny

 

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

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Users online (1,904)