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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Multiple Joins with Filters in DAX

I'm trying to recreate simple SQL query in DAX. The output Query needs to work in Power BI Report Builder paginated report and I have been trying all day reading all sorts of PowerBI / DAX online resources to rewrite this. A little bit about the data:

 

  • The data is structured in three tables: CostumCar, Engine and Chassis.
  • Basically "CarId" is the key that connects all three tables.
  • Lets assume all tables have more than 20 columns. so only a few of the columns are needed in the final output.
  • All three tables (CostumCar, Chassis and Engine) have IsActive property. (The relationship between Engine/Chassis to CostumCar is MANY-TO-ONE. Because an engine might blow up and they change it therefore somehow we want to track which Engine is on the car today and what engine was on it last year, however, at any time, there is only one active engine for each car. The same goes for Chassis)
  • Both Engine and Chassis have 'Manufacturer' and 'Model' columns so in the output query they need to be identified from each other.
  • I am not trying to sum any sort of sales number, just a list of cars with their current configuration.

 

 

Select
    CC.Name, CC.Model as 'CustomCarModel', CC.MaxSpeed,
    Ch.ChassisManufacturer as 'ChassisManufacturer', Ch.Model as 'ChassisModel', Ch.ManufacturedDate as 'ChassisManfDate',
    E.EngineManufactuer as 'EngineManufacturer', E.Model as 'EngineModel', E.Power, E.CylCount, E.ManufacturedDate
From CustomCars CC
Join Chassis Ch on Ch.CarID = CC.CarId
Join Engine E on E.CarID = CC.CarID
where
CC.IsActive = 1 and CC.FirstTestDriveYear < 1980 and
Ch.IsActive = 1 and
E.IsActive = 1​

 

 

… Any help is appreciated.

2 REPLIES 2
rfigtree
Resolver III
Resolver III

Hi, you asked how to write in DAx, but just in case.

 I don't use power bi report builder. But if you can use the power query part of bi it is simple, just merge the tables together, filter out unwanted rows, select columns you want. Same as the sql.

Anonymous
Not applicable

Thanks for the tip, unfortunately due the designed life cycle of paginated reports I have to write this query in report builder.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.