Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

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

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.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

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

@Anonymous ,

 

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

@Anonymous ,

 

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.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.