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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How can I add values in a Matrix? Please help

Hello,

 

I'm trying to add my values in my Table/Matrix on PowerBI and wanted to know if there was a way to do that without editing the source data. 

dillontoramall_0-1622768029703.png

 

In the simplest terms, I'm trying to add column 15 to column 3 and I want that SUM to replace the value in column 3. I also want column 15 to become 0. I'm very limited on what I can share regarding the data but this data is shared by a field called "Hours". The fields crossed in red are the various departments within the company producing these hours. Columns 15 and 3 should not be separate, they should be summed together.

 

Is it possible to create some measure that would allow me to do this? Thanks for the help.

 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Base data:

v-luwang-msft_0-1623224509343.png

Solution1:

Use the following dax to create a new column:

Column_new3 = SUM('Table'[Column15])
Column_15new = 0

Then get the below:

v-luwang-msft_1-1623225022938.png

Fianl delete before column and rename new column.

 

Solution 2:

Use the following dax to create a new table:

Table 2 =
SELECTCOLUMNS (
    'Table',
    "Column1", 'Table'[Column1],
    "Column2", 'Table'[Column2],
    "Column3", SUM ( 'Table'[Column15] ),
    "Column15", 0
)

Final get:

v-luwang-msft_2-1623225263792.png

 

And then could delete before table and rename new table.

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Base data:

v-luwang-msft_0-1623224509343.png

Solution1:

Use the following dax to create a new column:

Column_new3 = SUM('Table'[Column15])
Column_15new = 0

Then get the below:

v-luwang-msft_1-1623225022938.png

Fianl delete before column and rename new column.

 

Solution 2:

Use the following dax to create a new table:

Table 2 =
SELECTCOLUMNS (
    'Table',
    "Column1", 'Table'[Column1],
    "Column2", 'Table'[Column2],
    "Column3", SUM ( 'Table'[Column15] ),
    "Column15", 0
)

Final get:

v-luwang-msft_2-1623225263792.png

 

And then could delete before table and rename new table.

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

AllisonKennedy
Super User
Super User

@Anonymous  we need to know a bit more about the data model. Can you share the configuration of the matrix and is there only 1 row for [Hours] field? 

 

Using the FILTER or CALCULATE functions here could help. Alternatively you may be able create a New Group on the department column (Right click in the fields pane on Department field > New Group). If you are able, this might be better done in Power Query.


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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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