Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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 !
@Anonymous , not very clear, refer if this can help
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/
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.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
87 | |
81 | |
53 | |
37 | |
35 |