Forum Discussion
Display slicer hierarchy values
- Anonymous2 years ago
Hi,Anonymous 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.
If my understanding is correct, you can refer to my test below
The results of the test are as follows:
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 ) )Here is my test data:
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.
Hi,Anonymous 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.
If my understanding is correct, you can refer to my test below
The results of the test are as follows:
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 )
)
Here is my test data:
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.
- Anonymous2 years agoNot applicable
Thank you Anonymous it worked and issue solved. Many Thanks