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
Cobra77
Post Patron
Post Patron

Show different measures with Hierarchie filtered with combo chart

Hi 

 

we want to see on the graph 2 measures with classical hierarchy (no problem) , (mes1 and mes 2 )

And another measure (mes3)  that appears only when it's level without taking the kids

 

sample hierarchy :

Sample_hierarchy.jpg

sample1 : if i filter on Level3 with value "TY" , i want for mes3 only data with id on 5 (FK), no children ( with id 7,8,9,10,11)

sample2 : if i filter on Level1 with value "CC" , i want for mes3 only data with id on 1 (FK), no children ( with all id )

 

thanks for your helps

1 ACCEPTED SOLUTION

Hi @Maggie

by taking inspiration from your idea of a parameter table , its ok with this measure :

 

mes3 :=

VAR lvl = IF(HASONEVALUE('98 - Axe filter'[Level_flt]) && HASONEFILTER('98 - Axe filter'[Level_flt]); VALUES('98 - Axe filtre'[Level_flt]) ; -1)


VAR filt = FILTER('02 - Axe';'02 - Axe'[Level] = lvl )

 

RETURN IF ( lvl >= 0 &&
SWITCH(lvl ; 0 ; HASONEFILTER('02 - Axe'[level0] ) ;
1 ; HASONEFILTER('02 - Axe'[level1] ) ;
2 ; HASONEFILTER('02 - Axe'[level2]) ;
3 ; HASONEFILTER('02 - Axe'[level3]) ;
4 ; HASONEFILTER('02 - Axe'[level4]) ;
5 ; HASONEFILTER('02 - Axe'[level5]) ;
6 ; HASONEFILTER('02 - Axe'[level6]) ;
7 ; HASONEFILTER('02 - Axe'[level7]) ;
8 ; HASONEFILTER('02 - Axe'[level8])) ;
CALCULATE([NB] ; filt) ; BLANK())

 

thanks

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Cobra77

Please let me know if the result of your sample should be shown as below

Sample1

5.png

Sample2

4.png


we want to see on the graph 2 measures with classical hierarchy (no problem) , (mes1 and mes 2 )

And another measure (mes3)  that appears only when it's level without taking the kids

 



Where is your mes1 and mes 2 , are the columns on the picture columns not any measure you wanted?

 

Best Regards

Maggie

Hi @Maggie,

 

Yes for the mes3 this is the expected result

But for the mes1 and mes2 we want the children (it's ok for these measures)

 

the report can be filtered on different levels, on different columns of the hierarchy

 

 

mes_hierarchy.jpg

 

Thanks,

Best Regards

Hi @Cobra77

 

1.Enter data to create a new table

10.png

2.create a measure and add this measure to the Visual filter, and apply a filter in this measure to show when it is equal to 1.

 

Measure =
VAR myselection =
    SELECTEDVALUE ( Table1[selection], "selection" )
RETURN
    SWITCH (
        TRUE (),
        myselection = "level1", IF (
            MAX ( [Level2] ) = "NULL"
                && MAX ( [Level3] ) = "NULL"
                && MAX ( [Level4] ) = "NULL",
            1
        ),
        myselection = "level2", IF ( MAX ( [Level3] ) = "NULL" && MAX ( [Level4] ) = "NULL", 1 ),
        myselection = "level3", IF ( MAX ( [Level4] ) = "NULL", 1 ),
        1
    )

11.png

3.add the column Table1[selection], “level1”, “level2”, ”level3” to the slicer

12.png

 

Reference:

Using a Slicer to show different measures

 

Best Regards

Maggie

Hi @Maggie

by taking inspiration from your idea of a parameter table , its ok with this measure :

 

mes3 :=

VAR lvl = IF(HASONEVALUE('98 - Axe filter'[Level_flt]) && HASONEFILTER('98 - Axe filter'[Level_flt]); VALUES('98 - Axe filtre'[Level_flt]) ; -1)


VAR filt = FILTER('02 - Axe';'02 - Axe'[Level] = lvl )

 

RETURN IF ( lvl >= 0 &&
SWITCH(lvl ; 0 ; HASONEFILTER('02 - Axe'[level0] ) ;
1 ; HASONEFILTER('02 - Axe'[level1] ) ;
2 ; HASONEFILTER('02 - Axe'[level2]) ;
3 ; HASONEFILTER('02 - Axe'[level3]) ;
4 ; HASONEFILTER('02 - Axe'[level4]) ;
5 ; HASONEFILTER('02 - Axe'[level5]) ;
6 ; HASONEFILTER('02 - Axe'[level6]) ;
7 ; HASONEFILTER('02 - Axe'[level7]) ;
8 ; HASONEFILTER('02 - Axe'[level8])) ;
CALCULATE([NB] ; filt) ; BLANK())

 

thanks

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.