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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
Community Champion
Community Champion

wdx223_Daniel_0-1681789164174.pngwdx223_Daniel_1-1681789195868.png

 

 

wdx223_Daniel_2-1681789208859.png

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors