cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
baltermia_edu
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
amitchandak
Super User
Super User

@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 !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

View solution in original post

AllisonKennedy
Super User
Super User

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.

Please @mention me in your reply if you want a response.

Check out my Tokyo 2020 report with live stats - KUDOS much appreciated

Has this post solved your problem? Please Accept as 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 C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

manikumar34
Solution Sage
Solution Sage

@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
manikumar34
Solution Sage
Solution Sage

@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!




AllisonKennedy
Super User
Super User

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.

Please @mention me in your reply if you want a response.

Check out my Tokyo 2020 report with live stats - KUDOS much appreciated

Has this post solved your problem? Please Accept as 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 C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@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 !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Top Solution Authors