Forum Discussion
rod_puente
1 year agoHelper I
Help with Index for DAX
¡Hi Everyone! Pls, I need to know how I can add an index by DAX, so that I can have a cumulative sum like the following image: I need the index for DAX, I don't need it for Power Query....
- 1 year ago
To add an index column using DAX in Power BI, you can use several different functions depending on your specific needs. Here are a few common methods:
Using the ROW Function
Using the RANKX Function - Index = RANKX(ALL(Table), Table[Column], , ASC, DENSE)
Pls go through this - https://learn.microsoft.com/en-us/dax/index-function-dax
Using the COUNTROWS and FILTER Functions - Index = COUNTROWS(FILTER(Table, Table[Column] <= EARLIER(Table[Column])))
ryan_mayu
1 year agoSuper User
you can try this to create an index
Column = CALCULATE(DISTINCTCOUNT('Table'[client]),FILTER('Table','Table'[client]<=EARLIER('Table'[client])))
or create a measure
Measure = CALCULATE(DISTINCTCOUNT('Table'[client]),FILTER(ALL('Table'),'Table'[client]<=MAX('Table'[client])))