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
dann_dlr
New Member

Combine PivotTables using RELATED/LOOKUPVALUE

Hello, i'm quite new to PowerPivot/DAX in Excel and have a seemingly super simple question that I can manage to calculate in normal Excel formulas, but can't seem to get working in a PivotTable.

 

I have an extensive history of booked tasks with a date, daily description, a task number and an amount in USD. An example of this table is given below. This table is exported from an external program almost daily and therefore subject to changes. I have therefore added this to my datamodel using a 'Dynamic Range' using the Offset trick.

 

DateDaily_DescriptionTask_nrAmount
1-2-2023Direct saleTK202000
1-3-2023Direct saleTK101000
15-2-2023Extra sales from door-to-door-sales XA2500
29-3-2023Direct saleTK301000
7-2-2023Direct saleTK103500
6-3-2023Add. sales from tradeshowXA1200
21-3-2023Direct saleTK103600
27-2-2023Direct saleTK304800
5-3-2023Direct saleTK102100
2-2-2023Direct saleTK10700
24-2-2023Direct saleTK10300

 

Most of these tasks are booked directly on a Task number, however some are booked on a 'general number' (XA) and need a manual allocation, based on the Daily_Description column to the correct Task number. This is done in a separate table, as shown below:

Additional_sales_descriptionRelated_Task_nr
Extra sales from door-to-door-sales TK20
Add. sales from tradeshowTK10

 

Lastly, each Task comes with a specific task description, separate from the daily description. This task description is also manually entered in a separate table, as shown in the example below:

 

Task_DescriptionTask_nr
Task Description 20TK20
Task Description 10TK10
Task Description 30TK30

 

What I would like now, is a PivotTable that shows all of these things combined per task for both a specific period and in total. 

 

The PivotTable should combine the Task Description from table 3 for each task with the direct sales for a specific period (which is done by a PivotTable Timeline), as well as the indirect/additional sales per task from table 2. 

 

The table should look like this with the period after March 1st, 2023 (01-03-2023). (Dates are in dd-mm-yyyy). Bold columns are columns I can't seem to get working.

TaskDescriptiondirect_sales_periodindirect_sales_perioddirect_sales_totalall_sales_total
TK10Task Description 10670012001120012400
TK20Task Description 200020004500
TK30Task Description 301000058005800

 

The direct_sales_period is just a regular SUM with a filter and the direct_sales_total is a SUM with ALL dates.

 

However, the indirect_sales_period and all_sales_total rely on a link with table 2 and I can't seem to get it working with either a Relationship (RELATED) or a LOOKUPVALUE. Even for the simple Task Description from table 3, it doesnt seem to work. What is the correct way to approach this? In regular Excel formulas I would just use some SUMIFS.

1 REPLY 1
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1681789164174.pngwdx223_Daniel_1-1681789195868.png

 

 

wdx223_Daniel_2-1681789208859.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors