cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmg80525 Frequent Visitor
Frequent Visitor

Sort Array ASC Label Members as BEG, MID and END

Greetings.  I prefer to be able to do this utilizing M instead of DAX.  I have a table that will have two columns: one is the ID (Text) and the other, MD, contains integers.  I want to sort the table and then calculate a new column called POSITION to identify the first member of each unique ID array as BEG, the last as END, and all others as MID.  Example:

ID     MD    POSITION

A       1       BEG

A       2       MID

A       3       MID

A       4       END

B       3       BEG

B       7       MID         

B     12       MID

B     30       END

.....

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Sort Array ASC Label Members as BEG, MID and END

You can groupby the following:

Group.png

Expand the table out

Add a conditional column with


Condition Column.png

Remove columns and set data types. Final Table:

Final Table.png

View solution in original post

1 REPLY 1
Super User
Super User

Re: Sort Array ASC Label Members as BEG, MID and END

You can groupby the following:

Group.png

Expand the table out

Add a conditional column with


Condition Column.png

Remove columns and set data types. Final Table:

Final Table.png

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Top Kudoed Authors
Users Online
Currently online: 6 members 1,243 guests
Please welcome our newest community members: