Forum Discussion

akas2023's avatar
akas2023
Frequent Visitor
3 years ago
Solved

help needed

 present in culum chart     Thanks
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi akas2023 ,

    Please try below steps:

    1. please add a new tabel

    Table2:

    2. create measure with below dax formula

    B and Above Adj =
    VAR _class =
        SELECTEDVALUE ( 'Table 2'[Class] )
    VAR _year =
        SELECTEDVALUE ( 'Table 2'[Year] )
    VAR tmp =
        FILTER ( ALL ( 'Table' ), [Class] = _class && [Year] = _year )
    VAR tmp1 =
        FILTER ( tmp, UNICODE ( [Marks] ) <= UNICODE ( "B" ) )
    VAR _val =
        DIVIDE ( COUNTROWS ( tmp1 ), COUNTROWS ( tmp ) )
    VAR tmp2 =
        FILTER ( ALL ( 'Table' ), [Year] = _year )
    VAR _val1 =
        DIVIDE ( COUNTROWS ( tmp2 ), COUNTROWS ( ALL ( 'Table' ) ) )
    VAR _b =
        IF ( _class = "OverAll", _val1, _val )
    RETURN
        _b
    
    C and Above Adj =
    VAR _class =
        SELECTEDVALUE ( 'Table 2'[Class] )
    VAR _year =
        SELECTEDVALUE ( 'Table 2'[Year] )
    VAR tmp =
        FILTER ( ALL ( 'Table' ), [Class] = _class && [Year] = _year )
    VAR tmp1 =
        FILTER ( tmp, UNICODE ( [Marks] ) <= UNICODE ( "C" ) )
    VAR _val =
        DIVIDE ( COUNTROWS ( tmp1 ), COUNTROWS ( tmp ) )
    VAR tmp2 =
        FILTER ( ALL ( 'Table' ), [Year] = _year )
    VAR _val1 =
        DIVIDE ( COUNTROWS ( tmp2 ), COUNTROWS ( ALL ( 'Table' ) ) )
    VAR _b =
        IF ( _class = "OverAll", _val1, _val )
    RETURN
        _b
    

    3. add a clustered column chart with Table2 fields and measure

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.