Forum Discussion

Pbiuserr's avatar
Pbiuserr
Post Prodigy
4 years ago
Solved

Measure with criteria

Hello I want to create a measure and calculated column (later I need to make groups of these) where If value from the same line same table of Field1 Equals value from the same line same table of Fi...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  Pbiuserr ,

    I created some data:

    Table1:

    Table2:

    Here are the steps you can follow:

    1. Add Index to Table1 and Table2 in Power Query.

    In Power query. Add Column – Index Column – From 1.

    2. Create measure.

    Measure_Table2 =
    MAXX(FILTER(ALL(Table1),'Table1'[Index]=MAX('Table2'[Index])),[Field1])
    Measure with criteria =
    IF(
        MAX('Table2'[Field1])=[Measure_Table2],
        DIVIDE(MAX('Table1'[FieldX]),MAX('Table1'[FieldY]))  
        ,0)

    3. Result:

    If you need pbix, please click here.

    Measure with criteria.pbix

     

    Best Regards,

    Liu Yang

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