Forum Discussion
music583
4 months agoNew Member
Calculating Percentage A Given Value of One Column Has Values In Other Columns
I need to get a table that looks like this: Employee Deadline 1 Deadline 2 Deadline 3 Person 1 Yes Yes Yes Person 2 Yes No No Person 1 Yes No No Person 3 Yes Yes Yes ...
- 4 months ago
Just wrap the denominator in a FILTER to exclude blank rows:
Deadline 1 % = DIVIDE ( COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), Table1[Deadline 1] = "Yes" ) ), COUNTROWS ( FILTER ( KEEPFILTERS ( Table1 ), NOT ISBLANK ( Table1[Deadline 1] ) ) ) )
Deku
4 months agoSuper User
Something like below, with a measure per deadline field. For a clean model and more generalized solution you might be better off depivoting the data first, so that you have 3 columns: employee, deadline index, value
Deadline1_perc=
Var total = countrows( tbl )
Var metDeadline =
Calculate(
Countries( tbl ),
Tbl[deadline 1] = "Yes"
)
Return
metDeadline/total