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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Add Rows base on two colonnes condition

Hello, here my problem, I have a table with all the stock i own, with the date the currency and all the info for each day. 
My problem is in the statutory holiday. Im in Canada so there Canadien holiday wich the canadien stock are close that day and i own USA stock too and some day the USA market is close. 
In the data set, the colunms Date USA and Date Canada, whenever theirs a null, that mean that the stock market for the contry is close. They can be both close too.  So there 4 possibility totale, USA open Canada close, Canada open USA close, USA and Canada Open and both close. 
Now what i need to accomplish : 

I want to create a row base of that condition. 
When there a holiday in canada for exemple, i want to check the previous open day and take thoses on that row depending on how many stock canadien i own, and add it to the close day. For exemple, let say i own VFV.TO on the 2021-05-21 then for the 2021-05-24 wich is a close day here in Canada, i want to recreated the same row. That way my Canadien stock will have the same amount and not 0 that day. 
Same thing with the USA stock. 
Same thing if there are both close.
If the market is close in Canada and i dont have Canadien stock, do nothing ect.. 

Please help me im stuck on this probleme for a while now cant advance my dashbord without a solution. 

 

This is a exemple for a day close in the USA. I own USA stock the previous day ( the orange highlight). and the canadien stock show correctly (yellow highlight) 

 

Sorry for the bad english better in french 😅
Capture d’écran 2021-10-26 022037.png






1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I built a simple sample.

 

1.This is the sample data.

1.png

 

2.Select the StockSymbol column and the Currency column at the same time, then right-click and select Group by.

2.png

 

3.Selcet All Rows in the Operation.

3.png

 

4.Add a custom column.

Table.FillUp([Count],{"Value USA","Value Canda"})

4.png

5.png

 

5.Then expand the required columns and delete the unnecessary columns.

6.png

 

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

I built a simple sample.

 

1.This is the sample data.

1.png

 

2.Select the StockSymbol column and the Currency column at the same time, then right-click and select Group by.

2.png

 

3.Selcet All Rows in the Operation.

3.png

 

4.Add a custom column.

Table.FillUp([Count],{"Value USA","Value Canda"})

4.png

5.png

 

5.Then expand the required columns and delete the unnecessary columns.

6.png

 

 

 

Best Regards,

Stephen Tao

 

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

 

Anonymous
Not applicable

Thanks Stephen for the help, i found a solution by using multiple table tricks but when i got time im gonna test that function, but juste by reading it, it seem to do the good thing !

lbendlin
Super User
Super User

Not clear what your actual issue is. Power Query has a "Fill...Down" option. Have you tried that?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.