DAX to filter values based on other tables

Henceman

New Member
Joined
Oct 9, 2017
Messages
46
Hi,

I would need advice on how to create pivottable, based on inputs from several tables.

1. First I have an account masterdata table

AccountSignLevelhierarcy
10101UnitBalance sheet
5610-1PGP&L

This table defines characteristics of each account, and if the account data is needed to be detailed on product group level or can be summed ut to unit level


2. Second I have Balance sheet table, which roughly looks like this

Unit1Unit1Unit2Unit3
Account4456445755656652
1010500-560-56
5610300231700954


3. Third I have similar table for P&L values

Unit1
Unit1

Unit2
Unit3

Account
4456
4457
55656652
101056656522-0
56104563013

4. Fouth I have a table, which will list all the Units and their product groups, like that



UnitPG
Unit14456
Unit14457
Unit25565
Unit36652


End goal?

Pivot, which will:

-be based on the account list table (meaning, that every account in the list must be present in the table, value or no value)
-Based on account setting, must pick correct value from correct BS or PL table (in this exmple, if account 1010 is balance sheet account, then it must ignore the account value in P&L table and pick the value from BS table)
-If its determined which table is correct, it must check if account value needs to be summed across the PG-s the unit has OR repeat the account for every PG there is in the list. Meaning, if account is Unit total, then it cannot display every unit PG individually
-Of course, account table specifies the sign, so if -1 is present, that account needs to be with opposite sign.


An Pivot example based on the tables below

AccountUnitPGValue
1010Unit1444
1010Unit20
1010Unit3-56
5610Unit14456-456
5610Unit14457-3
5610Unit2556522
5610Unit36652-13



I hope my reasoning was understandable and doable with DAX, with so many filters...
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,213,567
Messages
6,114,344
Members
448,570
Latest member
rik81h

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