Power BI creating a table from another table

Emilia_Maria

New Member
Joined
May 11, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Dear Community,

I'm working currently on a visualisation for my work. I have data on companys, years, quarters and indicators. An indicator alfa is an average of 3 other indicators: beta, sigma delta. I wanna create a table in Power BI showing company name, quarter 4 of the previous year, quarter 4 of the current year, the difference of the indicator alfa and the contribution of the indicators beta, sigma, delta to this difference. I'm wondering if such a thing is possible in Power BI. I attached my excel file

Example_Indexes.xlsx
ABCDEFG
1FirmYearQuarteralfabetasigmadelta
2A201510,150,120,130,2
3A201520,1933330,10,250,23
4A201530,2366670,080,370,26
5A201540,280,060,490,29
6A201610,3233330,040,610,32
7A201620,3666670,020,730,35
8A201630,4100,850,38
9A201640,453333-0,020,970,41
10B201510,20,140,350,11
11B201520,2266670,320,290,07
12B201530,230,210,310,17
13B201540,2488890,2933330,2766670,176667
14B201610,2638890,3283330,2566670,206667
15B201620,2788890,3633330,2366670,236667
16B201630,2938890,3983330,2166670,266667
17B201640,3088890,4333330,1966670,296667
Arkusz1
Cell Formulas
RangeFormula
D2:D17D2=AVERAGE(E2,F2,G2)
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If this presentation works for you then the solution is in Power Query shown below
Book7
ABCDEFGHIJKLMN
1FirmYearQuarteralfabetasigmadeltaFirmQuarterAttribute20152016Subtraction
2A201510.150.120.130.2A1alfa0.150.3233333330.173333333
3A201520.1933330.10.250.23A1beta0.120.04-0.08
4A201530.2366670.080.370.26A1delta0.20.320.12
5A201540.280.060.490.29A1sigma0.130.610.48
6A201610.3233330.040.610.32A2alfa0.1933333330.3666666670.173333333
7A201620.3666670.020.730.35A2beta0.10.02-0.08
8A201630.4100.850.38A2delta0.230.350.12
9A201640.453333-0.020.970.41A2sigma0.250.730.48
10B201510.20.140.350.11A3alfa0.2366666670.410.173333333
11B201520.2266670.320.290.07A3beta0.080-0.08
12B201530.230.210.310.17A3delta0.260.380.12
13B201540.2488890.2933330.2766670.176667A3sigma0.370.850.48
14B201610.2638890.3283330.2566670.206667A4alfa0.280.4533333330.173333333
15B201620.2788890.3633330.2366670.236667A4beta0.06-0.02-0.08
16B201630.2938890.3983330.2166670.266667A4delta0.290.410.12
17B201640.3088890.4333330.1966670.296667A4sigma0.490.970.48
18B1alfa0.20.2638888890.063888889
19B1beta0.140.3283333330.188333333
20B1delta0.110.2066666670.096666667
21B1sigma0.350.256666667-0.093333333
22B2alfa0.2266666670.2788888890.052222222
23B2beta0.320.3633333330.043333333
24B2delta0.070.2366666670.166666667
25B2sigma0.290.236666667-0.053333333
26B3alfa0.230.2938888890.063888889
27B3beta0.210.3983333330.188333333
28B3delta0.170.2666666670.096666667
29B3sigma0.310.216666667-0.093333333
30B4alfa0.2488888890.3088888890.06
31B4beta0.2933333330.4333333330.14
32B4delta0.1766666670.2966666670.12
33B4sigma0.2766666670.196666667-0.08
Sheet1
Cell Formulas
RangeFormula
D2:D17D2=AVERAGE(E2,F2,G2)


simply a case of Unpivot the data and repivot with different criteria

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Firm", "Year", "Quarter"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Unpivoted Other Columns", {{"Year", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Unpivoted Other Columns", {{"Year", type text}}, "en-US")[Year]), "Year", "Value"),
    #"Inserted Subtraction" = Table.AddColumn(#"Pivoted Column", "Subtraction", each [2016] - [2015], type number)
in
    #"Inserted Subtraction"
 
Upvote 0
Solution

Forum statistics

Threads
1,214,621
Messages
6,120,563
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top