Forum Discussion

Devon_Runner's avatar
Devon_Runner
New Member
1 year ago
Solved

Create a table with values between from and to columns

HI   I would like to create a new table that shows the numbers in each Group ID, between 2 Ref ID columns   Current Data table Group ID Ref ID from Ref ID to Test1 500 999 Test2 10...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, Devon_Runner 

    I used your information to create a table named Table:

     

    Then try the following DAX expression to create a new table:

    NewTable = 
    SELECTCOLUMNS(
        ADDCOLUMNS(
            GENERATE(
                'Table',
                GENERATESERIES('Table'[Ref ID from], 'Table'[Ref ID to], 1)
            ),
            "Ref ID", [Value]
        ),
        "Group ID", 'Table'[Group ID],
        "Ref ID", [Value]
    )
    

     

    Here is my preview:

     

    How to Get Your Question Answered Quickly

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.