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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Karola
Advocate I
Advocate I

order of slicervalues in concatenatex DAX

Hello, 

 

I have a slicer with the following values: 
<60
61-120

121-200

201-300

>300
in my table i have a sorting table which sorts the values in this way. 

 

I want to show the selected values into a card  to make it easy for the customer to see what is selected. (I made a collapsible menu (with bookmarks) so the filter is not always visible)

The DAX itself works fine except the order of the values is incorrect. 

here's the DAX: 

Slicer selection test =
VAR c =
CALCULATE (
DISTINCTCOUNT ( 'Table1 Dim_LactationDay'[Category] ),
ALL ( 'Table1 Dim_LactationDay' )
)
= DISTINCTCOUNT ( 'Table1 Dim_LactationDay'[Category] )
RETURN
"Lactation stage: "
& CONCATENATEX (
VALUES ( 'Table1 Dim_LactationDay'[Category] ),
'Table1 Dim_LactationDay'[Category],
" & ",
'Table1 Dim_LactationDay'[Category], ASC
)

 

result: 
Image 016.png

so the order is way off here.. 

anyone has an idea to get the order the same way as in the slicer? 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Karola 
Please try

RETURN
    "Lactation stage: "
        & CONCATENATEX (
            SUMMARIZE (
                'Table1 Dim_LactationDay',
                'Table1 Dim_LactationDay'[Category],
                'Table1 Dim_LactationDay'[Sort]
            ),
            'Table1 Dim_LactationDay'[Category],
            " & ",
            'Table1 Dim_LactationDay'[Sort], ASC
        )

View solution in original post

2 REPLIES 2
Karola
Advocate I
Advocate I

Nice! that will do the trick

Thank you for your fast response and solution

tamerj1
Super User
Super User

Hi @Karola 
Please try

RETURN
    "Lactation stage: "
        & CONCATENATEX (
            SUMMARIZE (
                'Table1 Dim_LactationDay',
                'Table1 Dim_LactationDay'[Category],
                'Table1 Dim_LactationDay'[Sort]
            ),
            'Table1 Dim_LactationDay'[Category],
            " & ",
            'Table1 Dim_LactationDay'[Sort], ASC
        )

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.