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
How can i do that?
thanks
do you mean by year?
calculate(count(item),allexcept(table, year))
if you want distinct count ,try this
calculate(distinctcount(item),allexcept(table,year)
I tried the following & it works for my need
CALCULATE(
COUNT(_TempTable[item_code]),
ALLEXCEPT(_TempTable,_TempTable[item_code])
)
thanks for the tip
3 Replies
- ryan_mayu
Super User
do you mean by year?
calculate(count(item),allexcept(table, year))
if you want distinct count ,try this
calculate(distinctcount(item),allexcept(table,year)