Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Colleagues, hello!
I have a column with a period and a number of rows with data that equals the number of days in a month.
How can I put days from 1 to 28-31 in a separate column?
Solved! Go to Solution.
Hi @pani_victoria ,
To achieve this in Power BI, you can create a calculated column that assigns a day number (1 to 28/31) to each row within the month.
Create a Calculated Column: Use the following DAX formula to create a new column for days:
DayNumber = 
RANKX(
    FILTER(
        TableName,
        TableName[Period] = EARLIER(TableName[Period])
    ),
    TableName[IndexColumn],
    ,
    ASC
)
Result: This formula will rank rows within each month, creating day numbers 1 to 28/31 in a new column.
Please mark this as solution if it helps. Appreciate Kudos.
Hi @pani_victoria ,
To achieve this in Power BI, you can create a calculated column that assigns a day number (1 to 28/31) to each row within the month.
Create a Calculated Column: Use the following DAX formula to create a new column for days:
DayNumber = 
RANKX(
    FILTER(
        TableName,
        TableName[Period] = EARLIER(TableName[Period])
    ),
    TableName[IndexColumn],
    ,
    ASC
)
Result: This formula will rank rows within each month, creating day numbers 1 to 28/31 in a new column.
Please mark this as solution if it helps. Appreciate Kudos.
Thank you!
It works!)
but not for me
I didn't take into account some input data, because of which this solution doesn't work correctly
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.