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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Elieekh17
Helper I
Helper I

Display slicer hierarchy values

Hello Community,

 

I have a slicer with hierarchy: level 1: Group Header Code and Level 2 : Group Header Name. However when I select any value from the level 2 it displays automatically the relevant one in level 1 but If I choose the level 1 value from the column Group Header Code it only display the value without the second level.

 

SelectedValue  =
VAR Delimiter = " / "
VAR FilteredValues =
    FILTER (
        {
            IF (
                ISFILTERED ( SUPPLIERS[Group Header Code] ),
                "Group Header Code: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Code] ),
                        SUPPLIERS[Group Header Code],
                        ", "
                    ),
                BLANK ()
            ),
                IF (
                ISFILTERED ( SUPPLIERS[Group Header Name] ),
                "Group Header Name: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Name] ),
                        SUPPLIERS[Group Header Name],
                        ", "
                    ),
                BLANK ()
            )},
        NOT ( ISBLANK ( [Value] ) )
    )
RETURN
     "Suppliers : "
        & CONCATENATEX ( FilteredValues, [Value], Delimiter )

Can you please help

many thanks
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@Elieekh17 I am glad to help you.

According to your description, you have encountered this problem after creating a measure: when the slicer selects only the first level of the field, the slicer will automatically include all the values of the second field to be automatically checked, but in visual the total column of the measure only displays the value of the first level, but not the value of the second level which is automatically selected by the system.

But you want the total column to display both level1 and level2 values when the slicer selects level1.

like this.

vjtianmsft_0-1718682319463.pngvjtianmsft_1-1718682329701.png

If my understanding is correct, you can refer to my test below

The results of the test are as follows:

vjtianmsft_2-1718682348271.png

Here is  the DAX code

 

M_test = 
VAR Delimiter = " / "
VAR allLevel2_values=CALCULATE("Group Header Name: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Name] ),
                        SUPPLIERS[Group Header Name],
                        ", "
                    ),FILTER(ALLSELECTED('SUPPLIERS'),'SUPPLIERS'[Group Header Code]IN SELECTCOLUMNS('SUPPLIERS',"level2_values",'SUPPLIERS'[Group Header Code])))

VAR FilteredValues =
    FILTER (
        {
            IF (
                ISFILTERED ( SUPPLIERS[Group Header Code] ),
                "Group Header Code: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Code] ),
                        SUPPLIERS[Group Header Code],
                        ", "
                    ),
                BLANK ()
            ),
                IF (
                ISFILTERED ( SUPPLIERS[Group Header Name] ),
                "Group Header Name: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Name] ),
                        SUPPLIERS[Group Header Name],
                        ", "
                    ),
                BLANK ()
            )},
        NOT ( ISBLANK ( [Value] ) )
    )

RETURN
    IF(ISFILTERED(SUPPLIERS[Group Header Code])&&NOT(ISFILTERED(SUPPLIERS[Group Header Name])),
        "Suppliers : "
        & FilteredValues & Delimiter & allLevel2_values  ,
        "Suppliers : "
        & CONCATENATEX ( FilteredValues,  [Value], Delimiter )
    )

 

vjtianmsft_3-1718682392948.png

Here is my test data:

vjtianmsft_4-1718682412564.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

2 REPLIES 2
Anonymous
Not applicable

Hi,@Elieekh17 I am glad to help you.

According to your description, you have encountered this problem after creating a measure: when the slicer selects only the first level of the field, the slicer will automatically include all the values of the second field to be automatically checked, but in visual the total column of the measure only displays the value of the first level, but not the value of the second level which is automatically selected by the system.

But you want the total column to display both level1 and level2 values when the slicer selects level1.

like this.

vjtianmsft_0-1718682319463.pngvjtianmsft_1-1718682329701.png

If my understanding is correct, you can refer to my test below

The results of the test are as follows:

vjtianmsft_2-1718682348271.png

Here is  the DAX code

 

M_test = 
VAR Delimiter = " / "
VAR allLevel2_values=CALCULATE("Group Header Name: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Name] ),
                        SUPPLIERS[Group Header Name],
                        ", "
                    ),FILTER(ALLSELECTED('SUPPLIERS'),'SUPPLIERS'[Group Header Code]IN SELECTCOLUMNS('SUPPLIERS',"level2_values",'SUPPLIERS'[Group Header Code])))

VAR FilteredValues =
    FILTER (
        {
            IF (
                ISFILTERED ( SUPPLIERS[Group Header Code] ),
                "Group Header Code: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Code] ),
                        SUPPLIERS[Group Header Code],
                        ", "
                    ),
                BLANK ()
            ),
                IF (
                ISFILTERED ( SUPPLIERS[Group Header Name] ),
                "Group Header Name: "
                    & CONCATENATEX (
                        FILTERS ( SUPPLIERS[Group Header Name] ),
                        SUPPLIERS[Group Header Name],
                        ", "
                    ),
                BLANK ()
            )},
        NOT ( ISBLANK ( [Value] ) )
    )

RETURN
    IF(ISFILTERED(SUPPLIERS[Group Header Code])&&NOT(ISFILTERED(SUPPLIERS[Group Header Name])),
        "Suppliers : "
        & FilteredValues & Delimiter & allLevel2_values  ,
        "Suppliers : "
        & CONCATENATEX ( FilteredValues,  [Value], Delimiter )
    )

 

vjtianmsft_3-1718682392948.png

Here is my test data:

vjtianmsft_4-1718682412564.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

Thank you @Anonymous  it worked and issue solved. Many Thanks

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.