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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
alejandrodiaz
New Member

Sum Columns

Hello, I am new to Power Bi, and I wanted to see if you could help me solve this problem.

I have a dashboard that I consult from a table that is like this:

idConsultant  C1Support Consultant

SC1

1Juan8 

 

2Pedro4Alex

8

3Charly10Fer

5

4Julio8Alex

4

5Alex6Charly

3

6Pedro7Julio

4

7Juan7Fer

3

Fer5 

 

 

What I am trying to do is, add the occupation of a consultant, it does not matter if it is a regular consultant or a support consultant, you must add the c1 with the of sc1, something like this should remain on a dashboard....

I hope I have explained myself

 

Dashboard Column Chart

151113121813 
JuanPedroCharlyJulioAlexFer 
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @alejandrodiaz ,

 

Please create a new table.

 

NewTable = 
ADDCOLUMNS (
    DISTINCT (
        UNION ( VALUES ( 'Table'[Consultant] ), VALUES ( 'Table'[Support Consultant] ) )
    ),
    "Sum_C",
        CALCULATE (
            SUM ( 'Table'[C1] ),
            FILTER ( 'Table', 'Table'[Consultant] = EARLIER ( [Consultant] ) )
        )
            + CALCULATE (
                SUM ( 'Table'[SC1] ),
                FILTER ( 'Table', 'Table'[Support Consultant] = EARLIER ( [Consultant] ) )
            )
)

vkkfmsft_0-1655968437217.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @alejandrodiaz ,

 

Please create a new table.

 

NewTable = 
ADDCOLUMNS (
    DISTINCT (
        UNION ( VALUES ( 'Table'[Consultant] ), VALUES ( 'Table'[Support Consultant] ) )
    ),
    "Sum_C",
        CALCULATE (
            SUM ( 'Table'[C1] ),
            FILTER ( 'Table', 'Table'[Consultant] = EARLIER ( [Consultant] ) )
        )
            + CALCULATE (
                SUM ( 'Table'[SC1] ),
                FILTER ( 'Table', 'Table'[Support Consultant] = EARLIER ( [Consultant] ) )
            )
)

vkkfmsft_0-1655968437217.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@alejandrodiaz , Unpivot all 4 columns(last), then use replace value the attribute convert %sc1 to % c1. And the pivot again. you should get two columns

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.