Forum Discussion
Distinct count for specific values
Hello
I am new to Power BI and am looking to do a specific calculation. I have day to day data on the performance of several channels (there are about 100). Some days these channels perform very well, and others, not so well. Some of them do not perform at all (their value is 0).
I would like to:
1- Find the channels that are performing well (whose sum of a column is therefore greater than 0)
2- For these channels separately, add up what they cost each day
I have found how to make a distinct sum but I can't do it only for the channels that match this condition (that the sum of their performance is greater than 0)...
Of course I can do it by doing a matrix modeling, but I need this intermediate calculation to display a very precise indicator and therefore need a measure that evolves with time...
Any idea how to do it?
Thank you very much!
Have a nice day,
Elache ,
Try like
calculate(Sumx(Summarize( Table, Table[Channel], Table[Cost]), [cost]) , TOPN(1, filter(allselected('Table'[Channel]), Table[Cost]>0) , Sum(Table[Cost]),desc), values(Table[Channel]))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
2 Replies
- amitchandakSuper User
Elache ,
Try like
calculate(Sumx(Summarize( Table, Table[Channel], Table[Cost]), [cost]) , TOPN(1, filter(allselected('Table'[Channel]), Table[Cost]>0) , Sum(Table[Cost]),desc), values(Table[Channel]))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. - ElacheRegular Visitor
It did work perfectly! Thank you so much amitchandak ; i was lost since so long!