Forum Discussion

hjoshi4u26's avatar
hjoshi4u26
Regular Visitor
3 years ago
Solved

Power Query Group Data where value is >= 0

Hello All,

 

I have a Table show below

Ask is to Group the data by [Month] and Count Rows where [Value] >= 0. I have used below M-code but it is faulty.

= Table.Group(#"Changed Type", {"Month"}, {"Count", each Table.RowCount(Table.SelectRows(#"Changed Type", each [Value] >= 0))})

 

 

Can anybody please help me here and explain to me where I am wrong along with solution. It would be of much help. Thanks 🙂

  • You do no "group by". My solution:

     

    1) Filter first the column  

    2) Group by

     

     

    The result:

     

4 Replies

  • You do no "group by". My solution:

     

    1) Filter first the column  

    2) Group by

     

     

    The result:

     

    • hjoshi4u26's avatar
      hjoshi4u26
      Regular Visitor

      I cannot filter the data >=0 as there are other columns also which are being used for different calculations.

      • andhiii079845's avatar
        andhiii079845
        Icon for Solution Sage rankSolution Sage

        Than you have to make a full data example please! 🙂

        And your desired result. 

        For the "group by" you have to think about what should happend to the second column.