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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DeepDive
Helper IV
Helper IV

How to get Target Vs Ach, when multiple table joins required ?

Hello All,

Am unable to get Target Vs ach, My data is available in 3 tables. One is Sales data, Second is team mapping and third one is target table, problem here is Sales data linked to Team mapping file via customer and target is available by Sales Manager2 and by Brand in Target table. I need my output in below format.. I tried something but unable to solve the query... below is some code and also PBIX file is attached... Experts pls suggest with the best solution :

 

file link : https://drive.google.com/file/d/1Ca--t2D9abXK6NZkal07zCfjIB1XP6kt/view?usp=sharing

 

Code Tried :

Table =
Filter(
CrossJoin(

SelectColumns(
Sales,
"Sales_CustomerID", Sales[CustomerID],
"Sales_Brand", Sales[Brand],
"Sales_Qty", Sales[Qty]
),
SelectColumns(
TeamMapping,
"TeamMapping_CustomerID", TeamMapping[Cutomer],
"TeamMapping_SalesManagerL2", TeamMapping[SalesManagerL2]
),
SelectColumns(
Target,
"Target_Brand", Target[Brand],
"Target_SalesManagerL2", Target[SalesManagerL2],
"Target_Target", Target[Target]
)),
[Sales_CustomerID] = [TeamMapping_CustomerID]
&& [Sales_Brand] = [Target_Brand]
&& [TeamMapping_SalesManagerL2] = [Target_SalesManagerL2]
)
 
Below Tables are available and Need to get Output in below format
...TargetVsAch.png
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@DeepDive 

Rather than combining the sales and targets into a new table, you want look up tables for Managers, Brands and Dates.  Then you use the higher level tables to slice up your detail.

DeepDiveModel.jpg

I have update your file with the additional tables and attached it.

You should also take a look at the SQLBI Intro to DAX video course for some more info.  https://www.sqlbi.com/p/introducing-dax-video-course/. It's free

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@DeepDive 

Rather than combining the sales and targets into a new table, you want look up tables for Managers, Brands and Dates.  Then you use the higher level tables to slice up your detail.

DeepDiveModel.jpg

I have update your file with the additional tables and attached it.

You should also take a look at the SQLBI Intro to DAX video course for some more info.  https://www.sqlbi.com/p/introducing-dax-video-course/. It's free

Thanks a lot @jdbuchanan71 for your solution and valuable guidance.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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