Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX to filter values based on other tables

Hi,

 

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

  1. First I have an account masterdata tableimage.png

 

This table defines characteristics of each account, and if the account data is needed to be detailed on product group level OR summed to unit level (one or another, not both)

 

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

image.png

 

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

 

image.png

 

BS codes may appear here as well

 

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

 

image.png

 

 

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

 

image.png

 

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

2 REPLIES 2
lbendlin
Super User
Super User

Please show a sanitized version of your data model. 

Anonymous
Not applicable

Hi, Yes, its probably the best way, I created an example logic here

https://easyupload.io/ve0fq6

 

Thanks for review

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.