Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to find average using index substring

Hello All, 

 

Can someone help me  with the DAX command.

 

I would like to calculate the average of  score based on first 2 decimals of my Index Value.Basically the average for O.1, O.2. O.3......

 

 

Let me know, how to do this. I am really struggling.

 

Thanks,

 

1 Reply

  • Anonymous 

    First, add a column in Power Query: Add Column >  Extract > Text Before Delimiter

     


    Choose the options under Advance

    The in the Data model, add the following column using DAX

    Avg Index Value = 
    CALCULATE(
        AVERAGE(Table1[Value]),
        ALLEXCEPT(Table1, Table1[2 Digit Index] )
    )
    


    Result