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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
markjdm_17
New Member

Generate Series Based on Table (2 Columns)

Hi Team,

 

 I am looking at generating a series of columns based on a table as per below. 

 

Table: 

Trading NameOpen DateEnd Date
Centre 12/05/20202/08/2020
Centre 224/08/202024/11/2020

 

Results Table: 

Trading NameDateMonth
Centre 12/05/20201
Centre 12/06/20202
Centre 12/07/20203
Centre 12/08/20204
Centre 224/08/20201
Centre 224/09/20202
Centre 224/10/20203
Centre 224/11/20204

 

Now I was able to generate the table using the below guide but can't figure out how to add the series (Month) column. 

 

New Table =
SELECTCOLUMNS(
   FILTER(
         GENERATE(
                   'Table',
                   GENERATESERIES(MIN('Table'[Open Date]), MIN('Table'[End Date]), 1)
          ),
         [Value] >= [Open Date]
         && [Value] <= [End Date]
   ),
  "Label", [Trading Name],
   "Value", [Value]
)

 

https://community.powerbi.com/t5/Desktop/Generate-series-of-numbers-based-on-other-table-values/m-p/...

 

Cheers,
Mark

1 ACCEPTED SOLUTION

Thanks for all the responses. I was able to figure this out by just generating the series with the above dax query I mentioned.  I then just created a rank column to get the sequence of dates. 

 

Rank =
VAR D = 'Result Table'[Value]
VAR C = 'Result Table'[Label]
RETURN
CALCULATE(
RANK.EQ(D, 'Result Table'[Value], ASC),
FILTER(ALL('Result Table'), 'Result Table'[Label] = C)
)

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@markjdm_17 - If I am understanding this correctly, try this:

New Table =
SELECTCOLUMNS(
   FILTER(
         GENERATE(
                   'Table',
                   ADDCOLUMNS(
                     GENERATESERIES(MIN('Table'[Open Date]), MIN('Table'[End Date]), 1),
                     "Month",MONTH([Value])
                   )
          ),
         [Value] >= [Open Date]
         && [Value] <= [End Date]
   ),
  "Label", [Trading Name],
   "Value", [Value]
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@markjdm_17 , refer to my HR blog. Seems that can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for all the responses. I was able to figure this out by just generating the series with the above dax query I mentioned.  I then just created a rank column to get the sequence of dates. 

 

Rank =
VAR D = 'Result Table'[Value]
VAR C = 'Result Table'[Label]
RETURN
CALCULATE(
RANK.EQ(D, 'Result Table'[Value], ASC),
FILTER(ALL('Result Table'), 'Result Table'[Label] = C)
)

Hi @markjdm_17 ,

 

Glad to hear that. Please accept your reply as a solution so that people who may have the same question can get the solution directly. Your contribution is highly appreciated.

 

 

Best Regards,

Icey

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.