cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Resolver I

## New calculated column based on columns of the same table

Hi,

In this table I need to create a new calculted column that show the #User of the process 3 for all rows with the same TimeShiftBegin.

In this case, for the idProduction 74308 to 74314, it will be 401 in the new column.
Thanks

1 ACCEPTED SOLUTION
Solution Sage

This calculated column should work:

```#User =
VAR CurrentTimeShift = Table[TimeShiftBegin]
RETURN
CALCULATE (
MAX ( Table[idUser] ),
FILTER (
Table,
Table[idProcess] = 3
&& Table[TimeShiftBegin] = CurrentTimeShift
)
)```
3 REPLIES 3
Employee

Hi @FRG,

Based on my test, you could refer to below steps:

Sample data:

Create a new calculated column:

`Column = CALCULATE(MAX('Table1'[iduser]),FILTER('Table1','Table1'[Time]=EARLIER(Table1[Time])))`

Result:

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Solution Sage

This calculated column should work:

```#User =
VAR CurrentTimeShift = Table[TimeShiftBegin]
RETURN
CALCULATE (
MAX ( Table[idUser] ),
FILTER (
Table,
Table[idProcess] = 3
&& Table[TimeShiftBegin] = CurrentTimeShift
)
)```
Resolver I

Thanks @AkhilAshok, it works perfectly!

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors