Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Any help for Sorting based on a Slicer Value Section. Slicer will have the Column Names as List of Values used in a Table.
Solved! Go to Solution.
Hi,
Here is my test sample:
Please take following steps:
1)Create a slicer table by Enter Data:
2)Try this measure:
Measure =
SWITCH (
SELECTEDVALUE ( SlicerTable[Slicer] ),
"Sort by Date", RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
ASC,
DENSE
),
"Sort by Target_Sales", RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( SUM ( 'Table'[Target_Sales] ) ),
,
ASC,
DENSE
),
RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( SUM ( 'Table'[Actual-Sales] ) ),
,
ASC,
DENSE
)
)
3)Add this measure to the table visual, and set this visual sort by above measure:
4)When selecting one value in slicer, the result shows:
See my attached pbix file.
Best Regards,
Giotto
Hi,
Here is my test sample:
Please take following steps:
1)Create a slicer table by Enter Data:
2)Try this measure:
Measure =
SWITCH (
SELECTEDVALUE ( SlicerTable[Slicer] ),
"Sort by Date", RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
ASC,
DENSE
),
"Sort by Target_Sales", RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( SUM ( 'Table'[Target_Sales] ) ),
,
ASC,
DENSE
),
RANKX (
ALLSELECTED ( 'Table' ),
CALCULATE ( SUM ( 'Table'[Actual-Sales] ) ),
,
ASC,
DENSE
)
)
3)Add this measure to the table visual, and set this visual sort by above measure:
4)When selecting one value in slicer, the result shows:
See my attached pbix file.
Best Regards,
Giotto
@MKPBI_2805 , You have the option to choose a sort column, which means it is static. means no option to change.
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
What is that you want to achieve.
@MKPBI_2805 Don't think it is possible (As of today), to make sorting order by expression based (or selection based).
But will be interested in other community members thougts as well on this.
Proud to be a PBI Community Champion
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
64 | |
51 | |
39 | |
26 |
User | Count |
---|---|
86 | |
55 | |
44 | |
42 | |
36 |