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
sergiorodrigues
Frequent Visitor

DAX script to relate two separate fact tables with 1-* relashionship to the dimension table

Let's say I have the model below. A Car table, a table with all gas consumed by each car in the company and another table with car status for each date. I know the "Status" column should be modeled in the table with the gas data but it is what it is. 

sergiorodrigues_0-1615251017240.png

I'd like to generate a table using DAX with total gas consumed by each car in each status and grouped by month/year like below:

Month/YearCarStatus1Status2Status3
Jan/2020A10137
Feb/2020A12913
Jan/2020B1578
Feb/2020B47045

 

Any suggestions?

1 REPLY 1
amitchandak
Super User
Super User

@sergiorodrigues , You need to have common status and Date table too

 

how to get a common table in DAX -https://www.youtube.com/watch?v=Bkf35Roman8

 

power query

https://www.youtube.com/watch?v=kU2M1LmNvNo

https://www.youtube.com/watch?v=vHuhbvYCiNc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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