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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tangutoori
Helper III
Helper III

Need custom Column

Dear All,

Experts - @Ahmedx ,@amitchandak ,@v-tangjie-msft ,Greg_Deckler,@Greg_Deckler,@v-stephen-msft 

Need a custom colum as per requirment.

Group by ID, cosnider Current value of Maximum Serial number and assign to all the rows of that particular group. 

 

For AA group maximum serial number is 10 its Current value os 30Y0202, now assign 30Y0202 all the rows of AA in new column. 

 

Serial
Number
PreviousCurrentGroup IDlatest Part
1 30Y1664AA30Y0202
2 30Y0140AB30Y0140
330Y014030Y0140AB30Y0140
430Y014030Y0140AB30Y0140
530Y014830Y0148AC30Y0148
630Y166430Y1664AA30Y0202
730Y166430Y0202AA30Y0202
830Y166430Y0202AA30Y0202
930Y166430Y0202AA30Y0202
1030Y166430Y0202AA30Y0202

 

1 ACCEPTED SOLUTION
joaoribeiro
Impactful Individual
Impactful Individual

Hi @tangutoori ,

 

You can use the code below to create a Calculated Column to get the expect result (please adjust the code as you need):

 

 

Max Current =

VAR GroupId = 'Table'[Group ID]

VAR MaxSerialNumber =
CALCULATE(
    MAX('Table'[Serial Number]),
    FILTER('Table', 'Table'[Group ID] = GroupId)
)

RETURN
CALCULATE(
    MAX('Table'[Current]),
    FILTER('Table', 'Table'[Serial Number] = MaxSerialNumber)
)

 

 

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️or giving it a kudoe 👍

Thanks!

Best regards,
Joao Ribeiro

View solution in original post

2 REPLIES 2
tangutoori
Helper III
Helper III

Thank You.

joaoribeiro
Impactful Individual
Impactful Individual

Hi @tangutoori ,

 

You can use the code below to create a Calculated Column to get the expect result (please adjust the code as you need):

 

 

Max Current =

VAR GroupId = 'Table'[Group ID]

VAR MaxSerialNumber =
CALCULATE(
    MAX('Table'[Serial Number]),
    FILTER('Table', 'Table'[Group ID] = GroupId)
)

RETURN
CALCULATE(
    MAX('Table'[Current]),
    FILTER('Table', 'Table'[Serial Number] = MaxSerialNumber)
)

 

 

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️or giving it a kudoe 👍

Thanks!

Best regards,
Joao Ribeiro

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.