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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to Sort a Columns in a table by only using Slicer?

Hi Everyone, 

 

Requesting you post the solutin or any advice for the below question.

 

TABLE1

EMP IDSALARYSAVINGSEXPENSESTAX PAID
11000010009000500
2500015003500600
315000500010000700
4800024005400350
5900032005700550
675008006700700
760005005500800

 

Slicer 1

Metric (Drop down Silcer)
SALARY
SAVINGS
EXPENSES
TAX PAID

 

Slicer 2

Sort (Radio Button Slicer)
ASC 
DSC

 

Above is the TABLE1 consists of Columns SALARY, SAVINGS, EXPENSES, TAXPAID and there need  two slicers like as above Slicer 1 and Slicer .

 

Now the requirement is if i select one Metric from Metric Slicer Ex. SAVINGS and selected ASC then the SAVINGS Column in the table should sort in Ascending order and if select DSC then it should sort in the Descending Order in the Same table without any Bookmarks. 

 

Finally based on the Selection of Metric in Metric Slicer and Selection of Sort Slicer the Metric Value in the Table should Sort Accordingly.

 

Help me out with  closest solution.

Thanks in Advance.

 

Regards,

Pentakoa

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

Hi @Anonymous ,

 

You can try this measure

SORT =
SWITCH (
    SELECTEDVALUE ( 'Slicer 2'[Sort] ),
    "ASC",
        SWITCH (
            SELECTEDVALUE ( 'Slicer 1'[Metric] ),
            "EXPENSES", SUMX ( 'TABLE1', [EXPENSESASC] ),
            "SALARY", SUMX ( 'TABLE1', [SALARYASC] ),
            "SAVINGS", SUMX ( 'TABLE1', [SAVINGSASC] ),
            "TAX PAID", SUMX ( 'TABLE1', [TAX PAIDASC] )
        ),
    "DSC",
        SWITCH (
            SELECTEDVALUE ( 'Slicer 1'[Metric] ),
            "EXPENSES", SUMX ( 'TABLE1', [EXPENSESDESC] ),
            "SALARY", SUMX ( 'TABLE1', [SALARYDESC] ),
            "SAVINGS", SUMX ( 'TABLE1', [SAVINGSDESC] ),
            "TAX PAID", SUMX ( 'TABLE1', [TAX PAIDDESC] )
        )
)

8.png

 

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

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

6 REPLIES 6
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try this measure

SORT =
SWITCH (
    SELECTEDVALUE ( 'Slicer 2'[Sort] ),
    "ASC",
        SWITCH (
            SELECTEDVALUE ( 'Slicer 1'[Metric] ),
            "EXPENSES", SUMX ( 'TABLE1', [EXPENSESASC] ),
            "SALARY", SUMX ( 'TABLE1', [SALARYASC] ),
            "SAVINGS", SUMX ( 'TABLE1', [SAVINGSASC] ),
            "TAX PAID", SUMX ( 'TABLE1', [TAX PAIDASC] )
        ),
    "DSC",
        SWITCH (
            SELECTEDVALUE ( 'Slicer 1'[Metric] ),
            "EXPENSES", SUMX ( 'TABLE1', [EXPENSESDESC] ),
            "SALARY", SUMX ( 'TABLE1', [SALARYDESC] ),
            "SAVINGS", SUMX ( 'TABLE1', [SAVINGSDESC] ),
            "TAX PAID", SUMX ( 'TABLE1', [TAX PAIDDESC] )
        )
)

8.png

 

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

Hi @amitchandak Is there any solution for the same without using any Bookmarks?

@Anonymous , I doubt any other place you can control order by.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

No. It should be only in a slicer

Anonymous
Not applicable
amitchandak
Super User
Super User

@Anonymous , Please refer the last page (Sort Using Bookmarks) of the attached file. I tried creating it using bookmarks

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.