Forum Discussion
Calculated column- percentage using different columns
- 4 years ago
BhagyashriM42 here is a link to the file with the solution:
Test-calcolfile.pbix
Hello SpartaBI ,
I have tried with below calculated columns,but with no luck (basically total of happy should only have divided total of awareness,total of trust,total of diversity other than these KPI should be blank)
Happy_tag =
if('Table'[KPI]="Happy","Happy",BLANK())
Other_tags =
if('Table'[KPI]="Trust","Trust",
if('Table'[KPI]="Awareness","Awareness",
if('Table'[KPI]="Diversity","Diversity",BLANK())))
Final_calcol =
VAR _current_category = 'Table'[Category]
VAR _current_agegroup = 'Table'[Age-Group]
VAR _condition_1 = 'Table'[Happy_tag]
VAR _condition_2 = 'Table'[Other_tags]
VAR _num = COUNTROWS(
FILTER('Table',
'Table'[Category] = _current_category
&& 'Table'[Age-Group] = _current_agegroup
&& 'Table'[KPI]= _condition_2
)
)
VAR _denum =
COUNTROWS(
FILTER('Table',
'Table'[Category] = _current_category
&& 'Table'[Age-Group] = _current_agegroup
&& 'Table'[KPI]= _condition_1
)
)
VAR _result = DIVIDE(_num, _denum)
RETURN
_result
Thank you so much for your quick response.
Hey BhagyashriM42, already very late my timezone. PM me tomorrow as early your timezone you can and we could do a quick zoom and look together
- BhagyashriM424 years agoFrequent Visitor
- SpartaBI4 years agoCommunity Champion
I'm free now
- SpartaBI4 years agoCommunity Champion
BhagyashriM42 here is a link to the file with the solution:
Test-calcolfile.pbix