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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
abhiram342
Microsoft Employee
Microsoft Employee

Left outer join in DAX on Dimesnion and Fact

Hi all,

I have Fact and Dimension Table. I'm querying the cube using DAX code. I want to get all the values from dimension table irrespective they have value in Fact. Currenlty because 1 ( dimension) to many (fact) relationship between dimesnon and fact, I'm getting less records

EX:

Dimension

ProductIDProductName
1Cycle
2Car

Fact

DateProductIdAmount
2021-12-2012

 

final Result

ProductIDProductNameAmount
1Cycle2
2

bike

 

 

 

DAX Code: EVALUATE

SELECTCOLUMNS(

SUMMARIZE(

ProductId,ProductName,"TotalAmount",'Amount')

ProductId,

ProductName,

"TotalAmount","TotalAmount")

 

Thanks,

Abhiram

 

 

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @abhiram342 ,

 

Since you have a 1:* relationship between the Fact table and Dimension table, then to achieve a left outer join, you need to enable the option "Show items with no data" only.

 

vkkfmsft_0-1640316234202.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-kkf-msft
Community Support
Community Support

Hi @abhiram342 ,

 

Since you have a 1:* relationship between the Fact table and Dimension table, then to achieve a left outer join, you need to enable the option "Show items with no data" only.

 

vkkfmsft_0-1640316234202.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

abhiram342
Microsoft Employee
Microsoft Employee

Hi Vahid - Sorry , It's typo final result as below. Relationship betwen dimension and table is Star Schema 1 to many

ProductIdProductNameAmount
1Cycle2
2Car 
VahidDM
Super User
Super User

Hi @abhiram342 

 

Can you please let us know the relationship between those Fact and dimension tables? which columns and the cardinality?

 

Then how did you add Bike to the final result table?

 


Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Hi @VahidDM  - Sorry , It's typo, final result as below. Relationship betwen dimension and table is Star Schema 1 to many

ProductIdProductNameAmount
1Cycle2
2Car 

Hi @abhiram342 

 

use this code to create a new table:

Table = 
ADDCOLUMNS (
    'Dimension',
    "Amount",
        CALCULATE (
            SUM ( 'Fact'[Amount] ),
            FILTER ( 'Fact', 'Fact'[ProductId] = EARLIER ( 'Dimension'[ProductID] ) )
        )
)

 

Output:

VahidDM_0-1640065178517.png

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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