Forum Discussion
Powe BI Small Multiples Sorting Issues
Hi Anonymous ,
In Power BI, small multiples automatically sort based on the axis values and do not provide an option to sort rows based on the measure (value). However, you can achieve the desired sorting (i.e., sorting rows by descending value in each small multiple) using the following workaround:
- Steps to Sort Rows by Value in Small Multiples in Power BI
Create a Rank Measure for Sorting
You need to create a measure to rank the values for each date segment in small multiples.
RankMeasure = RANKX(ALLSELECTED('Table'[GroupID]), CALCULATE(SUM('Table'[Value])), , DESC, DENSE)
Create a Sorting Column Since Power BI does not allow dynamic sorting in small multiples, you need to create a calculated column that assigns a sorting value.
SortOrder =
RANKX(
FILTER(ALL('Table'), 'Table'[Date] = EARLIER('Table'[Date])),
CALCULATE(SUM('Table'[Value])),
,
DESC,
DENSE
)
This ensures that within each time period, the ranking is applied.
Sort the Y-Axis by the New Column
- Go to the Data view in Power BI.
Select the GroupID column.
Click Sort by Column and choose the SortOrder column.
Apply Small Multiples
- Add Date to Small multiples.
Add GroupID to the Y-axis.
Add your measure (SUM(Value)) to the X-axis.
Ensure that sorting is applied to GroupID using SortOrder. - Alternative: Using a Matrix Visual
If sorting within small multiples does not work as expected, you can also achieve a similar layout using a Matrix visual, where:
Rows: Group ID
Columns: Date (small multiples effect)
Values: SUM(Value), sorted in descending order.
π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!
- Anonymous1 year agoNot applicable
In my scenario, we cant go with Matrix. Have to show the value based on Legand.
Given Dax fuction also not working as expected. Here we have Date granulatity function like below based on the filter selection it has to shown either Year, Quarter,Month and Week.
Date Granularity = {("Year", NAMEOF('ShipOrderLine'[FISCAL_YEAR]), 0),("Quarter", NAMEOF('ShipOrderLine'[FISCAL_QUARTER_ID]), 1),("Month", NAMEOF('ShipOrderLine'[FISCAL_MONTH_ID]), 2),("Week", NAMEOF('ShipOrderLine'[FISCAL_WEEK_ID]), 3)}