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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-stephen-msft
Community Support
Community Support

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
v-stephen-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors