Forum Discussion
niko18033
6 years agoHelper I
Column to toggle between single or multiple categories
I want to create a column that allows me to toggle between emails associated with single or multiple clients (categories). I have a stacked column chart with the following fields. Axis: 'Email' ...
Anonymous
6 years agoNot applicable
[Email Type] = // calculated column
var __email = T[Email] // T is the table
var __howMany =
countrows(
filter(
T,
T[Email] = __email
)
)
return
If( __howMany > 1, "Multiple", "Single" )Here is your attribute...
Anonymous
6 years agoNot applicable
By the way, creating a measure - as vivran22 suggests - will be of no use to you in this regard. Secondly, this calculation should ideally be performed in Power Query since this piece of Power BI has been designed to efficiently deal with such problems through the M language. On top of that, if you do it in DAX, as I did above, the compression rate will not be optimal (but it might suffice). Please note that all preprocessing should be always performed in Power Query, not in DAX. DAX is a Data Analysis eXpressions language, not a data mashup language like M.
The fact that something is doable does not necessarily mean it should be done.