Forum Discussion
syafeeq
2 years agoNew Member
COUNT in new column
I am new with PowerBI I would like to count the number of item_code and put it in a new colum. so the new column will have item_code 1 = 3 item_code x = 2 item_code y = 1 etc ...
- 2 years ago
do you mean by year?
calculate(count(item),allexcept(table, year))
if you want distinct count ,try this
calculate(distinctcount(item),allexcept(table,year)
- 2 years ago
I tried the following & it works for my need
CALCULATE(
COUNT(_TempTable[item_code]),
ALLEXCEPT(_TempTable,_TempTable[item_code])
)
thanks for the tip
ryan_mayu
Super User
2 years agodo you mean by year?
calculate(count(item),allexcept(table, year))
if you want distinct count ,try this
calculate(distinctcount(item),allexcept(table,year)