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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Sum of filtered values

Hi everyone, 

 

In Power BI, I have a dataset that contains columns with ID and linked number.

It looks like this: 

[ID_01] [Number_01]  [ID_02] [Number_02]  [ID_03]  [Number_03]
    A        12         A         03         C          45
    A        43         B         12         B          64
    B        02         B         78         C          19 
    C        14         A         51         B          23

 

What I need is, for each line, to get the sum for each ID, which would look like this: 

[ID_01] [Number_01]  [ID_02] [Number_02]  [ID_03]  [Number_03] [SUM_A] [SUM_B] [SUM_C]
    A        12         A         03         C          45       15      00      45
    A        43         B         12         B          64       43      76      00
    B        02         B         78         C          19       00      80      19
    C        14         A         51         B          23       51      23      14

 

Do you have any idea of how I could achieve it ? 

Thank you so much !

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , not very clear, refer if this can help

https://www.youtube.com/watch?v=WSnB5y2JXv8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
DataZoe
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

You could do this with a calculated column in the table:

 

Sum A = if([ID_01] = "A",[Number_01],0)+if([ID_02] = "A",[Number_02],0)+if([ID_03] = "A",[Number_03],0)

 

and same for the other 2 columns.

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

Thank you very much, actually the syntax that worked on my side is : 

Sum A = (if [ID_01] = "A" then [Number_01] else 0)+(if [ID_02] = "A" then [Number_02] else 0)+(if [ID_03] = "A" then [Number_03] else 0)

 

With the if inside the brackets.

Anonymous
Not applicable

Hi @Anonymous ,

If your problem has been resolved, could you please mark the helpful post as Answered? It will help others in the community find the solution easily when they face the same problem with you.

Best Regards

Rena

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors