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
MohsinBipu
Helper I
Helper I

How to identify a text format in power query

I have an excel like below. I need to identify a text format (for my case XXX-XX-XX, example 122-22-10). And then I will take that cells including the upper cells.

In the full query, how I can do this? Please find below the Input snapshot and my expected output snapshot. 

 

MohsinBipu_0-1677730043685.png

 

2 REPLIES 2
MohsinBipu
Helper I
Helper I

OOhh my GOD.... you are just from out of the world.

Boss How I can learn those things? Any direction is greatly appreciated. 

wdx223_Daniel
Super User
Super User

NewStep=let fx=(t)=>let a=Text.Split(Text.From(t)??"","-") in List.Count(a)=3 and List.AllTrue(List.Transform(a,each _<>"" and Text.Remove(_,{"0".."9"})="")) in Table.FromColumns(List.Zip(List.Accumulate(Table.ToRows(PreviousStepName),{{},{}},(x,y)=>{x{0}&List.Zip(List.Select(List.Zip({x{1},y}),each fx(_{1}))),y}){0}))

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.