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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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