Forum Discussion
DAX index Function how to use?
- 2 years ago
Dicken , I created a table with the same code, and it worked
In case of measure use
Maxx( INDEX(1 , dDate, ORDERBY(dDate[Date]) ), [Date])
Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U
- 2 years ago
Dicken Try this :
use distinct around the table you are using in window functions
let me know if this works
Dicken , I created a table with the same code, and it worked
In case of measure use
Maxx( INDEX(1 , dDate, ORDERBY(dDate[Date]) ), [Date])
Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U
- Dicken2 years ago
Post Prodigy
So does it return a table, as that's what I was using;
New Table,
Table = INDEX(1, dDate, ORDERBY(dDate[Date],ASC)out of interest I get the same message for window.
Table 2 = WINDOW( 1,ABS,1,ABS,dDate ) again I get duplicate error message,so still none the wiser as to how it works,
i thought I'd try a simpler date table ;
dDate = ADDCOLUMNS(CALENDAR( DATE( 2020,1,1), DATE(2020,12,31) ),"Year", YEAR([Date]),"Month", FORMAT([Date],"MMM"))and put this into studio, but get message, an item with the saem key has already been added?
Don't have these problems in power pivot.
Richard- Daniel291952 years ago
Community Champion
Dicken Try this :
use distinct around the table you are using in window functions
let me know if this works
- Dicken2 years ago
Post Prodigy
Thanks,
RD
- Dicken2 years ago
Post Prodigy
Sorry, just to add did this in power pivot Dax studo, but this is what I would expect index to return,
a one row ( top ) table;EVALUATE FILTER( 'Calendar', 'Calendar'[Date] = DATE( 2020,1,1) )Richard.