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
ahmadov_10
Helper II
Helper II

using a current value for a column from Previous STEP - Power Query

Hello Experts,
My business need with Power Query :
I'm tried to save the same values in the columns (id_bu_rh) and (id_bu_ctr) ( a completed list of id) : for these reason i created the step Duplicated Column .
after i have a modification step called #"distinct annee, mois" : this is essential for work (but this step affects (id_bu_rh) , (id_bu_ctr) which become only with values : (0,1))

So I want to make a step that combine the columns
of #"distinct annee, mois" with the columns (id_bu_rh) , (id_bu_ctr) in the previous step Duplicated Column (or navigation)

this is my code this my power Query code and i think I am close to the result : just to fix how to call an element value (column) from a previous step :

 

let
Source = PostgreSQL.Database("localhost", "datamart"),
polaris_datamart_fait_ca = Source{[Schema="polaris_datamart",Item="all_combinationations_v"]}[Data],
#"Duplicated Column" = Table.DuplicateColumn(polaris_datamart_fait_ca, "id_bu_rh", "id_bu_rh - Copy"),
#"distinct annee, mois" = Table.Distinct(#"Duplicated Column", {"annee", "mois"}),
#"step_final" = Table.AddColumn(#"distinct annee, mois","col_bu_RH", each (#"Duplicated Column"[id_bu_rh]))
in
#"step_final"

 

( @amitchandak   , @selimovd   @parry2k  , @Greg_Deckler  @Pragati11  @MarcelBeug @v-qiuyu-msft 

 and all community of super stars , i need your helps ). BEST REGARDS

 

This is my screenshots below11.PNG22.PNG33.PNG

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@ahmadov_10 not sure I followed this step, you are creating a list with two values "anee and mois"

 

what you are trying to achieve here, I'm not fully sure from your post.

 

#"distinct annee, mois" = Table.Distinct(#"Duplicated Column", {"annee", "mois"}),

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @ahmadov_10 ,

 

I am not very much clear on the requirement. Can you add more details please?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

parry2k
Super User
Super User

@ahmadov_10 not sure I followed this step, you are creating a list with two values "anee and mois"

 

what you are trying to achieve here, I'm not fully sure from your post.

 

#"distinct annee, mois" = Table.Distinct(#"Duplicated Column", {"annee", "mois"}),

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k ,

your remark is very relevant : the step distinct (annee,month) is created with an old version in the project and i tried to understand it : i find in database editor with SQL query , that this is step is similar to over partition to save one row only for each (year , month) and the first row was always with id =0 or 1. so when we call the previous step that contains all the id to make an append operation (pervious id) to the actual step (actual id) ---> it will be the same , no changes (0,1) , and no errors.

because  : previous step : the completed table = 5000 rows

actual step (distinct (annee,mois) = 49 rows

 

Many thanks for you and @Pragati11  : I accept your answer as solution      

 

 

 

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
Top Kudoed Authors