Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
giordafrancis
Frequent Visitor

Using Dax only create an index column

Consider Table1 below , also note I'm not able to use Power Query currently for below report.

user_keyFYear
001    14/15 Q4
002    15/16 Q1
003    15/16 Q1
004    15/16 Q2

I want to create a new table (Table2) with the format below. It will capture all discint values from Table1[FYear] column.
@ddecker

FYearidx
14/15 Q4   1
15/16 Q1   2
15/16 Q2   3







1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @giordafrancis 

I only know how to create this table in two steps. I could not find a way to create it in one step.

 

step 1. create a Table

 

new table = SUMMARIZE('Table', 'Table'[FYear])
 
Step 2. create a calculated colum
 
idx =
CALCULATE (
SUMX ( 'new table', 1 ),
FILTER ( 'new table', 'new table'[FYear] <= EARLIER ( 'new table'[FYear] ) )
)
 
 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @giordafrancis 

I only know how to create this table in two steps. I could not find a way to create it in one step.

 

step 1. create a Table

 

new table = SUMMARIZE('Table', 'Table'[FYear])
 
Step 2. create a calculated colum
 
idx =
CALCULATE (
SUMX ( 'new table', 1 ),
FILTER ( 'new table', 'new table'[FYear] <= EARLIER ( 'new table'[FYear] ) )
)
 
 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@giordafrancis@Jihwan_Kim 

 

Here's how to do it in one go:

 

[New Table] =
    addcolumns(
        distinct( YourTable[FYear] ),
        "idx",
            var CurrentFYear = YourTable[FYear]
            return
            countrows(
                summarize(
                    filter(
                        YourTable,
                        YourTable[FYear] <= CurrentFYear
                    ),
                    YourTable[FYear]
                )
            )
    )
giordafrancis
Frequent Visitor

@amitchandak @Jihwan_Kim @Anonymous 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.