How to calaculate in DAX when you unpivot a tabel

okvals48

New Member
Joined
Sep 27, 2020
Messages
17
Office Version
  1. 365
Platform
  1. Windows
For my report i needed to unpivot my table so it looks like this
ASFASFAA.xlsx
DEFGH
4AccountCost CenterScenarioMonthValue
511111120201611
6111111202021967
7111111202031360
811111120204435
9111111202052416
101111112020628
1111111120211796
12111111202122302
13111111202131071
14111111202141746
15111111202151947
1611111120216326
1711111220201648
Sheet1
Cell Formulas
RangeFormula
H5:H17H5=+RANDARRAY(13,,15,2520,TRUE)
Dynamic array formulas.


I basicly have cleaned my data and unpivoted them for use in my report. I use cube functions to extract data (Cube value function IFERROR(N(CUBEVALUE("ThisWorkbookDataModel";"[Measures].["&$E$2&"]";"[OHv_PQ].[MJESEC].["&$E$3&"]";"[OHv_PQ].[KONTO].["&$D60&"]";"[OHv_PQ].[SCENARIO].["&I$5&"]";Slicer_MT));0) ). It works fine to extract data per month or year ia have writen a simple MTD and YTD measure, and control them by slicer.

Problem happens when i want to compere values between different scenarios for example. I look for diference betwen actual period and budget values and also i want to see percentual change.

For last part i have just subtrated cube values (i know that was not the smartest idea) for example Cube value"Actual" - Cube value"Budget", this is where things break a part. Slice for this part woudnot acepte when i change cost cente it always stay on whole year or month and just does not wnat to slice for diferences per cost center.

My question is it posible to write dax measure when i have pivot table as mine to calculate differences and percentual change and contol them by slicer. I have forgot to say that on slicer i only slice data per cost center

I do this in excel and not in PowerBi just to clerifay.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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