Adding multiple columns in Matrix columns

Sandeep3072

New Member
Joined
Jul 22, 2019
Messages
4
Hi All,

I am new to power BI and I have requirement to do in power BI where I need to show the some of key metrics in matrix format.

Here is the my requirement.

Well I am working for the Textile company where in I need to prepare the reports using Power BI and unfortunately I could not make it. I use matrix for the showing the differences of reports between 2018 and 2019.


Please check the below screen shot where I need to get the output like mentioned screenshot.



Please note that %Change in the above table is a measure which I had written % change = DIVIDE(CALCULATE(SUM(Table1[<wbr>Reports]),Table1[Year]=2019)-<wbr>CALCULATE(SUM(Table1[Reports])<wbr>,Table1[Year]=2018),
CALCULATE(SUM(Table1[Reports])<wbr>,Table1[Year]=2018))

When I am trying to add the same measure in my matrix the % change showing
for the both 2018 and 2019 years and I need it at the end of matrix.



You may check the my visualization pane to verify the rows and columns.


Is there any work around for the same issue and I've trying itfor a long time and finally seeking for your help.

Thanks for your support.





 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Matt Allington

MrExcel MVP
Joined
Dec 18, 2014
Messages
1,228
It seems your images didn't post on either thread. This makes it difficult for people to help you. I recommend you see if you can sort that out as there are lots of people willing to help for free - but you have to make it easy for them. You issue is that you have put year on the columns in your report and also a measure. This creates 2 levels of data. The top level is the year and underneath that is the measure. In your case, the years are 2018 and 2019, and the measure is simply showing the % change for 2019 vs 2018, hence the problem. Better to write 3 measures.

Total 2018 = CALCULATE(SUM(Table1[Reports])<wbr style="color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">,Table1[Year]=2018)
Total 2019 =
CALCULATE(SUM(Table1[Reports])<wbr style="color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">,Table1[Year]=2019)
% change = DIVIDE([Total 2019] -[Total 2018],[Total 2018])

If you add these 3 measures, it will be at a single level and hence it will do what you want.

Better still, write these measures
Code:
Total This Year = VAR ThisYear = max[COLOR=#000000](T[/COLOR][COLOR=#000000]able1[Year])[/COLOR][COLOR=#000000]
                         RETURN CALCULATE(SUM(Table1[Reports])[/COLOR]<wbr style="color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">[COLOR=#000000],Table1[Year]=ThisYear)
[/COLOR]Total Last Year = VAR LastYear = max[COLOR=#000000](T[/COLOR][COLOR=#000000]able1[Year][/COLOR][COLOR=#000000])-1
                         RETURN CALCULATE(SUM(Table1[Reports])[/COLOR]<wbr style="color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">[COLOR=#000000],Table1[Year]=LastYear)[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#000000]% change = DIVIDE([Total This Year] -[Total Last Year],[Total Last Year)[/COLOR]
Add the 3 measures to the matrix and add a slicer from the year column. When you select the year in the slicer, it will update to show you the selected year and prior year
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,623
Messages
5,512,458
Members
408,898
Latest member
Glenno557

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top