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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply

Need Help with Power Query

Hello,
Can anyone please help me with following question:
Q: I need to create an column which gives and count for the meeting which sales person has done. I have attached the snap here for the reference. Eg. Mr. Tarun has done 6 as 'First Meeting' and 2 as 'Month qualified' and 1 as 'Proposal submitted' and 'Month on won'. The count of date instances is what I need to do.

virendrajadhav1_0-1690441617959.png

 

The ideal solution should look like below.

virendrajadhav1_1-1690441897000.png


Thank you in advance



5 REPLIES 5
androo
Advocate II
Advocate II

I think this will help you to figure it out for yourself. The way your code is now it is jumping over the step with Daniel's suggested solution in it. Power Query Advanced Editor - What Is It and How to Use It? - Bing video

androo
Advocate II
Advocate II

PreviousStepName is a placeholder for YOUR previous step name. It looks like your previous stepname is "Renamed Columns". You will see this more clearly if you open the query in the advanced editor. To do that at the screen you have shown above go to the "Home" menu and then look for "Advanced Editor" and click on it. You will then see your code (that which making the steps in the products GUI has generated) and you can then change the placeholder "PreviousStepName" to the name of your previous step, which seems to be "Renamed Columns". Similarly where Daniel writes "NewStep" that is a placeholder for the name of your "New Step" which seems to be "Custom" (the default name of for a new step which is adding a new column from the GUI). The way Daniel presented his solution he assumed you were familiar with, or at least knew about, the "Advanced Editor" and how M Code is written when you are working directly in the advanced editor.

Hello,
Thanks for writing me. Please accept my apologies for asking such a basic question. You are right, Power Query is absolutely new territory for me.
Per your instruction, I have tried advanced query option. I didn't get any error but seems like nothing has changed in the table. Please take a look at the snap and hopefully you will guide me again. 🙂


virendrajadhav1_0-1690463160082.png

 

wdx223_Daniel
Super User
Super User

NewStep=Table.Group(PreviousStepName,"SalesOwner",List.Transform(List.Skip(Table.ColumnNames(PreviousStepName)),(x)=>{x,each List.NonNullCount(Table.Column(_,x))}))

Hello Daniel,
Thanks for the answer. Although, I am getting a syntex error for the same. Any thoghts?

 

virendrajadhav1_0-1690445072786.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors