Forum Discussion
luccaguimaraes
4 years agoFrequent Visitor
How to create a Row Column in DAX
Hi, I need to create a column that contains the row number, exactly like the red numbers on the print below: *It has to be on DAX because It is a calculated table from M code *It will always...
- 4 years ago
Here is one way to do it with DAX (without RANKX). Just create a DAX table with the expression below.
MonthTable =
VAR fourmonthsago =
EOMONTH( TODAY(), -4 )
VAR monthdates =
ADDCOLUMNS(
GENERATESERIES( 1, 4, 1 ),
"Mes/Ano", FORMAT( EOMONTH( fourmonthsago, [Value] ), "mmm/yy" )
)
RETURN
monthdatesPat
mahoneypat
4 years agoMicrosoft Employee
Here is one way to do it with DAX (without RANKX). Just create a DAX table with the expression below.
MonthTable =
VAR fourmonthsago =
EOMONTH( TODAY(), -4 )
VAR monthdates =
ADDCOLUMNS(
GENERATESERIES( 1, 4, 1 ),
"Mes/Ano", FORMAT( EOMONTH( fourmonthsago, [Value] ), "mmm/yy" )
)
RETURN
monthdates
Pat