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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Matt Allington

MrExcel MVP
Joined
Dec 18, 2014
Messages
1,221
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
 

Watch MrExcel Video

Forum statistics

Threads
1,101,903
Messages
5,483,628
Members
407,400
Latest member
Rakeforms

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top