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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Girish_123
Helper I
Helper I

group the value wherever is break

Hi Team, I have a one column want to create new column problem is whenereve there is value other than one make it in a new group 
how to achive the result in power query or dax calculation below is sample input column and output column
Input Column               Output Column
1                                          G1
1                                          G1
1                                          G1
1                                          G1
23                                        G2
1                                          G2
1                                          G2
12                                        G3
1                                          G3
1                                         G3
1                                          G3
43                                         G4
1                                           G4

2 REPLIES 2
AlienSx
Super User
Super User

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    g = Table.Group(Source, "Input Column", {{"all", each _}}, GroupKind.Local, (s, c) => Number.From(c <> 1)),
    idx = Table.AddIndexColumn(g, "Output Column", 1, 1),
    prefix = Table.TransformColumns(idx, {"Output Column", each "G" & Text.From(_)}),
    r = Table.RemoveColumns(prefix,{"Input Column"}),
    e = Table.ExpandTableColumn(r, "all", {"Input Column"})
in
    e
ToddChitt
Super User
Super User

Try this in Power Query:

Add a Custom Column with a formula like this:

if [input column] = 1 then null else [input column]

Now do a FILL DOWN operation on this column. Note that the first group G1 may be NULL so you may also have to do a REPLACE VALUES and replace NULL with some unique string or number.

Next do a GROUP BY of this column




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors