cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Need help with calculated column

Hi,

 

I am new to power BI. Need to create a calculated column in a sales fact table, by dividing unit QTY of the fact table items by the convertion column of the item dimention table. Relationships are created correctly. Help me on this..

 

Isuru

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Supplier
Solution Supplier

Re: Need help with calculated column

Hi,

If the relationships are created, you can use RELATED function in DAX to fetch field from item dimension and use it in fact table.

Below e.g uses Cost field from Product table to calculate the total cost.

 

Total Cost = SUMX( Sales, Sales[Quantity] * RELATED('Product'[Cost]) )

Thanks.

View solution in original post

4 REPLIES 4
Highlighted
Solution Supplier
Solution Supplier

Re: Need help with calculated column

Hi,

If the relationships are created, you can use RELATED function in DAX to fetch field from item dimension and use it in fact table.

Below e.g uses Cost field from Product table to calculate the total cost.

 

Total Cost = SUMX( Sales, Sales[Quantity] * RELATED('Product'[Cost]) )

Thanks.

View solution in original post

Highlighted
Frequent Visitor

Re: Need help with calculated column

Hi,

 

I tried below dax function but it didn't work.

 

Cs = DIVIDE(FactStock[UnitQty],RELATED(DimItem[Conversion]),0)
 
No errors but giving the same value in the unitQTY column. not dividing by conversion.
 
 
Highlighted
Solution Supplier
Solution Supplier

Re: Need help with calculated column

Hi,

Can you share a sample dataset with the expected result.

Thanks.

Highlighted
Frequent Visitor

Re: Need help with calculated column

Hi,

 

Yes Vaibhavdesai. It's working fine. Thanks for the support.

 

Isuru

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors