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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
vhsn
Frequent Visitor

Top N and Others with relation to dimension table

Hello!

About Top N and Others, I've successfully done it with various guide - https://goodly.co.in/top-n-and-others-power-bi/ as one of them..

However, my Product is in the form of Product ID and I have a dimension table for it - and I want to display the Product Name instead of the Product ID

 

 

Basically:

Table: Dim_Product

Product ID | Product Name

 

1 to many relationship with

 

Table: Sales Table

Product ID | Sales

 

Measure: Top N Sum Sales

My calculation relates to the 'Sales Table'[Product ID]

 

I assumed I could create a relationship between measure and the dimension table - but it seems that's not the case..

I feel like I'm missing something here, it should be relatively simple to do..?

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @vhsn 

You can refer to the following solution.

You can use the topn() filter to the visual

Put the product name to the filter, then select filter type to topn

vxinruzhumsft_0-1696818813923.png

Then select the value by the measue(sumsales)

You can refer to the following link.

zebrabi.com

 

Best Regards!

Yolo Zhu

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

 

 

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @vhsn 

You can refer to the following solution.

You can use the topn() filter to the visual

Put the product name to the filter, then select filter type to topn

vxinruzhumsft_0-1696818813923.png

Then select the value by the measue(sumsales)

You can refer to the following link.

zebrabi.com

 

Best Regards!

Yolo Zhu

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

 

 

rubayatyasmin
Super User
Super User

Hi, @vhsn 

 

Here are some suggestions you want to follow,

  1. Ensure there's a relationship between Dim_Product and Sales Table on Product ID.
  2. Create your Top N measure based on sales in the Sales Table.
  3. In your visualization (e.g., chart or table), use Product Name from Dim_Product for display, and your Top N measure for values.
  4. Power BI will use the relationship to match Product Name with its respective sales and show the top N products by name.

You don't need a direct relationship with the measure and dimension table; the existing relationships between tables will enable this to work.

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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