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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

calculate average

hi everybody,

 i dont know if the title corespond to the request but i need your help.

i want to calculate the averge of month promotion for each employee 

i use distinct it doesnt work.

i want to create a new calculate column that can identify the first line and put 1 if its different from the previous id and blank if the id of row context is similar to the previous context 

Column = if(CALCULATE(min(table[id]),FILTER(table,table[id]<>EARLIER(table[id]))),1,BLANK())Untitled.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

You can create a new calculate column like so:

1. In Query Editor, add an Index column from 1;

calculate average 2.png

2. Create columns:

Column =
VAR PreviousIndex = 'Table'[Index] - 1
RETURN
    'Table'[id]
        - CALCULATE (
            VALUES ( 'Table'[id] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Index] = PreviousIndex )
        )


Column 2 =
IF ( 'Table'[Column] = 1, 1, BLANK () )

calculate average.PNG

 

Best Regards,

Icey Zhang

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

You can create a new calculate column like so:

1. In Query Editor, add an Index column from 1;

calculate average 2.png

2. Create columns:

Column =
VAR PreviousIndex = 'Table'[Index] - 1
RETURN
    'Table'[id]
        - CALCULATE (
            VALUES ( 'Table'[id] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Index] = PreviousIndex )
        )


Column 2 =
IF ( 'Table'[Column] = 1, 1, BLANK () )

calculate average.PNG

 

Best Regards,

Icey Zhang

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

 thank you @Icey  its was what i need i appreciate .

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors