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! Request now

Reply
Anonymous
Not applicable

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.

Capture.JPG

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

1 ACCEPTED SOLUTION
AkhilAshok
Solution Sage
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
        )
    )

View solution in original post

3 REPLIES 3
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

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

Sample data:

1.PNG

Create a new calculated column:

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

Result:

1.PNG

 

You could also download the pbix file to have a view.

 

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.
AkhilAshok
Solution Sage
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
        )
    )
Anonymous
Not applicable

Thanks @AkhilAshok, it works perfectly!

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 Solution Authors