cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

How can I SUM all values which have a specific value in the same row?

I really don't know how to form this question, I hope it's not that bad.

 

What I want is the following:

I have a slicer in which are phone numbers.
In the table is alawys the phone number and the cost, like this (recreated in excel):

baltermia_edu_0-1603365083553.png

Now I need the SUM of all rows in costs from the specific phone number (which would be the SELECTEDVALUE in the slicer).

 

It would be like this (excel again):

baltermia_edu_1-1603365167184.png

With input I mean the SELECTEDVALUE in the slicer.

 

In the end the SUM should be shown in a card, but all I really need is the DAX code.

 

Thanks in advance.

3 ACCEPTED SOLUTIONS
Super User IV
Super User IV

@baltermia_edu , is that not just a sum of the column. You can use the phone number in slicer it will filter?



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Super User III
Super User III

If the Phone and Cost are both in the same table, you don't need SELECTEDVALUE - the SUM(Cost) will automatically filter based on the slicer selection. All you need to do is put SUM(Cost) as DAX or even just put Cost column in Card visual with SUM aggregation and select the phone number from the slicer.

If any of the terms I've used don't make sense, let me know and I'll send links or screenshots. If I've missed something in your post, let me know and I'll come back to reply.

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

View solution in original post

Super User I
Super User I

@baltermia_edu ,

 

Slicer will take Distinct values. When you place your numeric column on the visual it will be automatcially Summed most of the times. 

 

You don't require DAX in this scenario, if you just want to show your Total cost when Phone selected on the slicer because the values will be summarized and shown on the vislaus with filters. 

 

Rehards, 

Manikumar 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

3 REPLIES 3
Super User I
Super User I

@baltermia_edu ,

 

Slicer will take Distinct values. When you place your numeric column on the visual it will be automatcially Summed most of the times. 

 

You don't require DAX in this scenario, if you just want to show your Total cost when Phone selected on the slicer because the values will be summarized and shown on the vislaus with filters. 

 

Rehards, 

Manikumar 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

Super User III
Super User III

If the Phone and Cost are both in the same table, you don't need SELECTEDVALUE - the SUM(Cost) will automatically filter based on the slicer selection. All you need to do is put SUM(Cost) as DAX or even just put Cost column in Card visual with SUM aggregation and select the phone number from the slicer.

If any of the terms I've used don't make sense, let me know and I'll send links or screenshots. If I've missed something in your post, let me know and I'll come back to reply.

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

View solution in original post

Super User IV
Super User IV

@baltermia_edu , is that not just a sum of the column. You can use the phone number in slicer it will filter?



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors