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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Devon_Runner
New Member

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 IDRef ID fromRef ID to
Test1500999
Test210001499

 

Requirement

Group IDRef ID
Test1500
Test1501
Test1502
Test1999
Test21000
Test21001
Test21002
Test21499
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Devon_Runner 

I used your information to create a table named Table:

vyohuamsft_0-1727057996328.png

 

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:

vyohuamsft_2-1727058066451.png

 

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.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Devon_Runner 

I used your information to create a table named Table:

vyohuamsft_0-1727057996328.png

 

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:

vyohuamsft_2-1727058066451.png

 

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.

HotChilli
Community Champion
Community Champion

In Power Query {500..999} is a list that contains all the numbers between these 2 limits.

So,  add a custom column and use the column headings to make your list, then expand the list.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.