Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Count values for a column while filtering another column

Hi Power BI Comunity, please help I need to count values for column "Items_Category" in Power BI, if my source only gives me 2 columns- Category & Items? Items_Category is the output in 3rd column/...
  • Pragati11's avatar
    6 years ago

    Hello @Gguliani ,

    Try creating a column like the following:

    CountCalc ? CALCULATE(SUM(tablename[Items]), FILTER(tablename, tablename[Category] ? EARLIER(tablename[Category] )))

    Thank you

    Pragati