Forum Discussion
Anonymous
4 years agoNot applicable
[DAX] MIN function rejects single column table as argument
Hi all! I was wondering if [Single-Column Table] = [Column] for Power BI? I'm trying to use the MIN function on a table I create dynamically with TOPN and it gives me the "The MIN function only acc...
- 4 years ago
Hi Anonymous
Use MINX like this example
MINX(SELECTCOLUMNS(TOPN(2,'Submission Date', 'Submission Date'[Submission Date],DESC),"Index",[Index]), [Index])Regards
Phil
PhilipTreacy
Super User
4 years agoHi Anonymous
SELECTCOLUMNS returns a table but MIN requires a column (or a scalar value) as an argument. MINX takes a table as an argument then works through each row.
So even though you are creating a table, consisting of just one column, using SELECTCOLUMNS, it's still creating a table, and MIN doesn't like that.
Regards
Phil