Forum Discussion
help needed
- Anonymous3 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 _bC 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 _b3. 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.
Hi akas2023 ,
Why Year1, 2019-2020, B and above is 82%? why is not 67%? could you please explain the calculate rule?
Best regards,
Community Support Team_Binbin Yu
The percentage is correct but the problem is I cannot include whole table bcoz of characters limitation.kindly help to how to do.thanks
- Anonymous3 years agoNot applicable
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 _bC 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 _b3. 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.