cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

Sum 2 columns in matrix table

Hi is it posible to sum 2 columns from 14 in matrix view as a extra column in the same view.

This is list of person nad summary work time for certain topics i need in this matrix extra sum of time spend on 2 topix together.

I want to add 1 extra column to this matrix with number 15 and the valu for this column will be sum of col 3 and 4.

1 ACCEPTED SOLUTION
Super User

It's possible but not simple. The problem is that you currently have one measure (llosc_dni) computed against two dimensions (Nazwisko_imie and Title) but you want to add a new measure that acts as an extra Title dimension value. Measures get evaluated in the context generated by the dimensions you put on the rows and columns, which is why if you add a new measure, it shows up under each number 1-14.

To do what you want, there are two approaches I can think of:

1. Remove the Title dimension from columns and create separate measures for each number you want to show.
2. Alter the existing table or create a new table to use as your header that includes 15 and define a measure that switches calculations accordingly.

Here's an example of the second approach for a similar but more complex situation:

https://stackoverflow.com/questions/52632713/custom-aggregate-column-in-power-bi-matrix

9 REPLIES 9
Super User

It's possible but not simple. The problem is that you currently have one measure (llosc_dni) computed against two dimensions (Nazwisko_imie and Title) but you want to add a new measure that acts as an extra Title dimension value. Measures get evaluated in the context generated by the dimensions you put on the rows and columns, which is why if you add a new measure, it shows up under each number 1-14.

To do what you want, there are two approaches I can think of:

1. Remove the Title dimension from columns and create separate measures for each number you want to show.
2. Alter the existing table or create a new table to use as your header that includes 15 and define a measure that switches calculations accordingly.

Here's an example of the second approach for a similar but more complex situation:

https://stackoverflow.com/questions/52632713/custom-aggregate-column-in-power-bi-matrix

New Member

Thank you very much. You saved me.

Frequent Visitor

How did you manage to get it right?

Super User

@swartor  Kindly share the Column name you want to add? Or simply share the screen shot like below:

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
New Member

Super User

@swartor  Try this:

= Calculate(SUM(Ilosc_dni),Title IN {3,4})

OR

= CALCULATE(SUM(Ilosc_dni), Title=3 || Title =4)

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
New Member

Sry for this question but i dont know where to add this.

Do i hav to create a new measure and insert it to columns or hav to make some code editing but dont know where.

Super User

@swartor Just create a new Measure with that given code.

MEASURE= CALCULATE(SUM(Ilosc_dni), Title=3 || Title =4)

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
New Member

Ok i create it like this

MEASURE = CALCULATE(SUM('test importu'[Ilosc_dni]), 'RCP-Statusy'[Title]=3 || 'RCP-Statusy'[Title] =4)

But i cant add it to Columns and when i add it to Values i get view like this

Do i hav to make separate measure for every column i want and then add one by one to Values?

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

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

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors