Forum Discussion
Visualization Summary
Hello Community,
I am a new PowerBI user. I have a table visualization with fields from three tables. I have verified that the results displayed are correct. I now want to count the number of entries, and do a sum on the currency field. When I try to use the sum function on the currency field; it will add all of the values in the table, not just the values in the visual. The same thing happens when I try to do a count. Any ideas why this is happening?
Sincerely,
Peter
- Anonymous6 years ago
Hi Anonymous ,
If i understand you correctly, ALLSELECT() function might be helpful for you.
Please refer to the measures below and modify your measures.
sum = CALCULATE(SUM('Table'[PotentialValue]),ALLSELECTED('Table')) count = CALCULATE(COUNT('Table'[ID]),ALLSELECTED('Table'))Result would be shown as below.
BTW, since the filters you used are visual level filter, they can't affect other views such as SUM and COUNT above.
Instead, you can use page level filter if you want.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
8 Replies
- az38Community Champion
Hi Anonymous
are you doing it as measure and inside the "calculate" container?
for example
Measure = calculate(sum([currency]))do not hesitate to give a kudo to useful posts and mark solutions as solution
- AnonymousNot applicable
Hello,
Thank you for the quick reply. I am using the desktop client, to create a report and have imported the three tables. As I create the report, with the visual highlighted: I go to the fields list and select the 'down' ceveron and select the summary function I want to use (count on the ID field, or sum on the AnnualSales field.
Sincerely,
Peter
- az38Community Champion
Anonymous
try go to the Fileds pane, right click to you table and New Measure
Measure = calculate(sum([currency]))then add your Measure to the visual and set Do not aggregate in Vizualization pane
this technique is enable you a "row-context"and should give you a value in accordance with other column in the each row
do not hesitate to give a kudo to useful posts and mark solutions as solution
- AnonymousNot applicable
Hi Anonymous ,
If i understand you correctly, ALLSELECT() function might be helpful for you.
Please refer to the measures below and modify your measures.
sum = CALCULATE(SUM('Table'[PotentialValue]),ALLSELECTED('Table')) count = CALCULATE(COUNT('Table'[ID]),ALLSELECTED('Table'))Result would be shown as below.
BTW, since the filters you used are visual level filter, they can't affect other views such as SUM and COUNT above.
Instead, you can use page level filter if you want.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.