Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to create a top n and others column based on sales in the fact table. I can do this for a dimension directly linked to the fact table. However, I'm struggling to create one for a dimensional attribute.
For example, the fact table has a product key which links to the product table. I have created a top n products and others column based on the RANKX function and it works fine. But I need to create a top n colours and others column. Colour is an attribute in the product table and more than one product can share a colour.
I can't get the RANKX to focus on the colour column rather than the product table as a whole. I guess it's probably not possible. I would like to use this for other attributes so hoping not to have to add a colour key to the fact table.
I hope this makes sense and would greatly appreciate any advice or pointer to a solution.
Solved! Go to Solution.
I managed to do this using the same RANKX based TopN+other column on a colours table joined to colours column in the Product table (1-many), so can still link back to sales table.
I guess I'll need more such tables if I need more TopN+others on attributes, but better than messing with the fact table. Model beginning to look more like snowflake.
Thanks for the pointer johnt75. It may have an even better answer but it was a frighteningly big article!
I managed to do this using the same RANKX based TopN+other column on a colours table joined to colours column in the Product table (1-many), so can still link back to sales table.
I guess I'll need more such tables if I need more TopN+others on attributes, but better than messing with the fact table. Model beginning to look more like snowflake.
Thanks for the pointer johnt75. It may have an even better answer but it was a frighteningly big article!
The SQL BI guys have an excellent article on video on this - https://www.sqlbi.com/articles/filtering-the-top-products-alongside-the-other-products-in-power-bi/ . Should be possible to segment by any attribute on the product table.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |