Forum Discussion

iamprajot's avatar
iamprajot
Icon for Responsive Resident rankResponsive Resident
8 years ago
Solved

How to write this Condition in Power BI

I need the Name of the Product from TableA for which I have recieved most Quotes.

for e.g. Select Name of Product where Max ( Count (Quotes ) )

 

Also the Name of the Product from TableA for which I have recieved most Quotes and for which ... (Another Condition).

for e.g. Select Name of Product where Max ( Count (Quotes ) ) and where Count (Quotes ) >100

  • It is working and I am accepting it as a solution however if you could tell me any other simpler way then it would be great as it seems a lot confusing.

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Perhaps something along the lines of:

     

    MyMax = CALCULATE(MAX(Table([Product]),FILTER(Table,MAXX(Table,COUNT([Quotes])))
    • iamprajot's avatar
      iamprajot
      Icon for Responsive Resident rankResponsive Resident

      This is exactly what I am using and it seems very feasible but it is not giving desired results always.

      I am using slicers/filters and it ives correct results for some and incorrect result for the rest.

      I don't know on what basis it is giving rubbish results.

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        Could be that you need to add an ALL or ALLEXCEPT clause or something along those lines. Can you post some sample data and description of where you are seeing the issue?