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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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.

Anonymous
Not applicable

Hi,

 

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

 

Isuru

Anonymous
Not applicable

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.
 
 
Anonymous
Not applicable

Hi,

Can you share a sample dataset with the expected result.

Thanks.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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