Forum Discussion
depple
7 years agoHelper III
Top N Filter - Biggest changes
Hi, I would like to create a visual that shows the 10 products with the biggest changes in volume. As these can be both positive and negative, I tried to created an ABS-value measure for use in V...
- 7 years ago
Hi depple
If you have a visual showing any measure by Product, you can certainly filter Product to the Top 10 based on absolute variance.
I created a simple example PBIX here and did the following:
- Started with a Sales Amount Variance measure (in my example a year-on-year variance)
- Created a SalesAmount Variance Absolute measure:
Sales Amount Variance Absolute = ABS ( [Sales Amount Variance] )
- Created a visual showing Sales Amount Variance by Product, with a Top N filter on Product, set to Top 10 by Sales Amount Variance Absolute,
- To illustrate that it's working correctly, created a visual showing Sales Amount Variance without the filters, with a Rank measure defining the colour (based on this article😞
Rank of Product by Absolute Variance = IF ( ISINSCOPE( Sales[Product] ), RANKX ( CALCULATETABLE ( VALUES ( Sales[Product] ), ALLSELECTED ( Sales[Product] ) ), [Sales Amount Variance Absolute] ) ) - Appears as follows:
Hopefully that helps. Please post back if needed.
Regards,
Owen
OwenAuger
7 years agoSuper User
Hi depple
If you have a visual showing any measure by Product, you can certainly filter Product to the Top 10 based on absolute variance.
I created a simple example PBIX here and did the following:
- Started with a Sales Amount Variance measure (in my example a year-on-year variance)
- Created a SalesAmount Variance Absolute measure:
Sales Amount Variance Absolute = ABS ( [Sales Amount Variance] )
- Created a visual showing Sales Amount Variance by Product, with a Top N filter on Product, set to Top 10 by Sales Amount Variance Absolute,
- To illustrate that it's working correctly, created a visual showing Sales Amount Variance without the filters, with a Rank measure defining the colour (based on this article😞
Rank of Product by Absolute Variance = IF ( ISINSCOPE( Sales[Product] ), RANKX ( CALCULATETABLE ( VALUES ( Sales[Product] ), ALLSELECTED ( Sales[Product] ) ), [Sales Amount Variance Absolute] ) ) - Appears as follows:
Hopefully that helps. Please post back if needed.
Regards,
Owen