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
MylèneB
Helper II
Helper II

Custom column isn't in power bi query afterward

Hi!

 

I have a list of names, and if they exist more than once, I would like to add a '2' at the end of their name. So John Doe and John Doe2 for example. I tried to do this manipulation to see where are my duplicates: https://community.powerbi.com/t5/Desktop/Count-duplicate-values-and-number-them-as-1-2-3/td-p/297968 in Power Bi desktop. 

I didn't find a way to do it directly in power bi query editor, so I added the columns in the power bi report. But, when I open the power bi query editor, they don't appear. I would like to replace all the '1' for blank so I can concatenate the names after. 

 

Why the custom columns added in power bi 'regular' don't appear in my power bi query editor after? Can someone help me?

 

Thank you!

 

 

3 ACCEPTED SOLUTIONS
camargos88
Community Champion
Community Champion

Hello @MylèneB ,

Mark this file as an example: Download PBIX

Groups the name and assigns an index for it when it is greater than 1.

Did I answer your question? Mark my position as a solution!
Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

v-diye-msft
Community Support
Community Support

Hi @MylèneB 

 

You can access it directly in power query instead of the report model, please refer to:

https://community.powerbi.com/t5/Desktop/How-to-count-duplicate-values-in-M/td-p/312604 

https://community.powerbi.com/t5/Desktop/Adding-conditional-index-based-on-changing-field-in-Power-Q... 

Below simple example for your ease:

 

06.PNG

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTK00HUsKFKK1YFyLVG4Rsaosrq+iZVgnhNI0hAuiYVrbIDCNYFojQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Group     " = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Group     ", type text}, {"Date", type date}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Group     "}, {{"Count", each Table.AddIndexColumn(_,"Index",1,1), type table }}),
    #"Expanded Count" = Table.ExpandTableColumn(#"Grouped Rows", "Count", {"Date", "Index"}, {"Date", "Index"})
in
    #"Expanded Count"

 

 

08.PNG

Community Support Team _ Dina Ye
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

@MylèneB ,

 

If you create columns using DAX, you don't see them on Query Editor, just the base table or custom transformation made in Power Query.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

6 REPLIES 6
v-diye-msft
Community Support
Community Support

Hi @MylèneB 

 

You can access it directly in power query instead of the report model, please refer to:

https://community.powerbi.com/t5/Desktop/How-to-count-duplicate-values-in-M/td-p/312604 

https://community.powerbi.com/t5/Desktop/Adding-conditional-index-based-on-changing-field-in-Power-Q... 

Below simple example for your ease:

 

06.PNG

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTK00HUsKFKK1YFyLVG4Rsaosrq+iZVgnhNI0hAuiYVrbIDCNYFojQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Group     " = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Group     ", type text}, {"Date", type date}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Group     "}, {{"Count", each Table.AddIndexColumn(_,"Index",1,1), type table }}),
    #"Expanded Count" = Table.ExpandTableColumn(#"Grouped Rows", "Count", {"Date", "Index"}, {"Date", "Index"})
in
    #"Expanded Count"

 

 

08.PNG

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

Hello @MylèneB ,

Mark this file as an example: Download PBIX

Groups the name and assigns an index for it when it is greater than 1.

Did I answer your question? Mark my position as a solution!
Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi!

 

Yes, it does the trick, but how can I group the names column without deleting all my other columns?

 

Thank you!

Hi @MylèneB ,

 

I deleted just to show the results.

When you group all rows by name, you don't lose any data.

If you check the file, after grouping it has a step to expand the table.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Thank you @camargos88 ! It worked! 

 

Do you know however why the columns created in the report doesn't appear in the query editor?

@MylèneB ,

 

If you create columns using DAX, you don't see them on Query Editor, just the base table or custom transformation made in Power Query.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



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.