I have 15 columns in a power bi table. I would like to create new measure that will return the column names if the percentage value of any columns is less than 60%.
Example table:
ID | total | col2 | col3 | col4 | col5 |
---|---|---|---|---|---|
a100 | 50 | 35 | 10 | 5 | 6 |
a101 | 36 | 25 | 5 | 12 | 18 |
I created a new measure for each column that shows the percentage
%col2 = SUM(col2)/SUM(total)*100
%col3 = SUM(col3)/SUM(total)*100
%col4 = SUM(col4)/SUM(total)*100
%col5 = SUM(col5)/SUM(total)*100
By the new measure above, I will get col2 >60%
What I would like is to create a visual, maybe by kpi or a table that will return only the columns that have less than 60%.
I tried the following:
col_to_improv = SWITCH(TRUE(), OR(table[col2] < 60, "columnname", table[col3] < 60, "col_name2", table[col4] < 60, "col_name3"), table[col5] < 60, "col_name4],"")
I would like to show only the column names that has less than 60%, otherwise, do not show.
From the above example table, In the kpi (or other visual), I am expecting only col3,col4, and col5, because they have less than 60%.