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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Karola
Helper I
Helper 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
Helper I
Helper 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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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