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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
AnilKumar
Helper II
Helper II

repeat column values based on another column

Hi all,

I am Struggling since long back. I have data like 

Order numoriginal dateactual dateinvoiced amt times
Order1June-2016June-20161
Order1sept-2016march-20173
Order1dec-2016march-20182
Order1march-2017  
Order1june-2017  
Order1sept-2017  
Order1dec-2017  
Order1mar-2018  
Order1june-2018  

 

What i Need is a new column which will be like,

Order numoriginal dateactual dateinvoiced amt timesNEw Colum
Order1June-2016June-20161June-2016
Order1sept-2016march-20173march-2017
Order1dec-2016march-20182march-2017
Order1march-2017  march-2017
Order1june-2017  march-2018
Order1sept-2017  march-2018
Order1dec-2017   
Order1mar-2018   
Order1june-2018   

 

So based on the No.of times column, the new column shold be derived.

 

Please suggest an idea.

 

Thanks in Advance.

Regards,

Vishnu priya

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @AnilKumar

 

You can create a index column in Query Editor firstly: 

 

a1.PNG

 

Then create calculated columns below: 

 

EndRowNum = CALCULATE(SUM('Table'[invoiced amt times]),FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])))
 
StartRowNum = 'Table'[EndRowNum]-'Table'[invoiced amt times]+1
 
Column = CALCULATE(MIN('Table'[actual date]),FILTER('Table',EARLIER('Table'[Index])>='Table'[StartRowNum]&&EARLIER('Table'[Index])<='Table'[EndRowNum]))
 
w4.PNG
 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
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

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Based on the 3rd and 4th columns, you want to generate the 5th column.  What is the use of the 1st and 2nd columns?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,
The first column is about the order number. There might be n number of orders. And the 2nd column tells the data about the month to be invoiced.
Based on this only the no.of records of particular order depends.
Thanks & regards ,
Vishnu priya
v-qiuyu-msft
Community Support
Community Support

Hi @AnilKumar

 

You can create a index column in Query Editor firstly: 

 

a1.PNG

 

Then create calculated columns below: 

 

EndRowNum = CALCULATE(SUM('Table'[invoiced amt times]),FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])))
 
StartRowNum = 'Table'[EndRowNum]-'Table'[invoiced amt times]+1
 
Column = CALCULATE(MIN('Table'[actual date]),FILTER('Table',EARLIER('Table'[Index])>='Table'[StartRowNum]&&EARLIER('Table'[Index])<='Table'[EndRowNum]))
 
w4.PNG
 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks. It worked for my case.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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