Forum Discussion

villa1980's avatar
villa1980
Resolver II
2 years ago
Solved

Min and All except in Power Query

Hi All,

 

 I am trying to replicate a DAX expression within Power Query which I can then use to filter the underlying data, however, when trying to replicate it within Power Query I am getting blanks when should be returning values.

Is something very simple I am not doing in Power Query, but any help would be good

 

DAX Expression

Min_Index = CALCULATE(
    MIN(Sheet1[Index]), ALLEXCEPT(Sheet1,Sheet1[Combination])
    )
 
POWER QUERY
List.Min([Index],[Combination])

Many Thanks
 
Alex
  • NewStep=let a=Table.Group(YourTable,"Combination",{"min",each List.Min([Index])}) in Table.AddColumn(YourTable,"MinIndex",each a{[Combination=[Combination]]}[min])

4 Replies

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

    NewStep=let a=Table.Group(YourTable,"Combination",{"min",each List.Min([Index])}) in Table.AddColumn(YourTable,"MinIndex",each a{[Combination=[Combination]]}[min])

    • villa1980's avatar
      villa1980
      Resolver II

      Hi wdx223_Daniel,
      Thanks for the reply, wow that is quite complicated compared to DAX 🙂

      I have added the column with your formula but unfortunately still comes back blank. I have included the screenshot below to show it.

      So as you can see I have many lines for 2 entities in the Combinations Column, would like it to say 1 as the Min Index

       

      • m_dekorte's avatar
        m_dekorte
        Resident Rockstar

        Hi villa1980 

         

        To resolve the issue, share your implementation of the provided solution by wdx223_Daniel and make sure that code section includes at least the previous and next step as well