Forum Discussion
Dax Help
- 9 years ago
CheenuSing
Actually I figured it out as soon as i posted it and its similar to what you have posted. But I ended up using the measure as per below:
All Categories 3 & Above = CALCULATE(
COUNTROWS(Table),
Table[Column1]> 2, Table[Column2]> 2, Table[Column3]>)Thanks to everyone for thier contibution.
Hi,
You could do as suggested and it would work. I might consider avoiding too many "IF" statements as it might cause issues with performace in large data sets especially if you go onto to use these measures in other complex measures.
A calculated column might be easiest especially if you want to deal with more than three columns.
CalColumn =
MIN ( MIN ( [Basketball], [Tennis] ), [Hockey] )
There may be a more elegant mathmatical way to get the smallest of more than three numbers but I also can't think of it right now.
Then your measure would be (assuming one row per person in this case):
CountNamesGrtr3 :=
CALCULATE (
COUNTROWS ( 'DataTable'), filter('DataTable','DataTable'[CalColumn] >= 3 )
)
You could use COUNTX and build the MIN function into the filter but I would probebly avoid that and take the additional overhead of the calculated column.
Hope this helps.
Thomas