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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cross1987
Regular Visitor

Adding a custom column to allow a filter in Table.profile

At present I have a table of data, made up of several sources: A,B,C & D that have issues assigned to them.

What I want to be able to do is use the Table.Profile capability to profile the data so I can see the min, max, etc etc - this part is fine, what I am struggling with is adding a custome column to this to allow me to filter the min max etc by source:

Source Column (which the table is filterable by) then have the table.profile columns of the column, Min, Max etc

2 REPLIES 2
Anonymous
Not applicable

You could group your a, b, c, d, and then choose the All Rows aggregation. Then you could add a custom column with each Table.Profile(_[TableColumn]))

 

--Nate

edhans
Super User
Super User

Not sure what you are getting at. A screenshot of a mockup would help. However, you can add custom aggregations to Table.Profile.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitWBsIzgLGMwywnIMoGzTOEsM6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Source = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Value", Int64.Type}}),
    Custom1 = 
        Table.Profile(
            #"Changed Type",
            { 
                {"Median", each Type.Is(_, type nullable number), List.Median},
                {"Mode", each Type.Is(_, type nullable number), List.Mode} 
            }
        )
in
    Custom1

 

Turns this:

edhans_0-1700581497783.png

into this

edhans_1-1700581545752.png

How to use M code provided in a blank query:
1) In Power Query, select New Source, then Blank Query
2) On the Home ribbon, select "Advanced Editor" button
3) Remove everything you see, then paste the M code I've given you in that box.
4) Press Done
5) See this article if you need help using this M code in your model.

 

If you need more help, please provide more info per below:

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.