cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Calculate measure from a different fact table

Hi everyone,

could anyone help me with the formula?

I have two fact tables NetSales and Lead Table.

NetSales Table has Customer ID, Date, Material#, Volume columns

Lead Table has Customer ID, Lead Start Date (different customers could have different lead start date with same campaign ID), Campaign ID.

And I want to calculate the volume for Material A for customers 12 months before the leads start date.

I have formula below and it doesn't work.

CALCULATETABLE(
SUMMARIZECOLUMNS(
RELATEDTABLE(NetSales),
"Vol",CALCULATE(Sales[Vol],DimProduct[PRH2#]="011")
),

Thanks,

Shayla

1 ACCEPTED SOLUTION
Community Support

Hi @shayla,

As per your description, I have created two tables and created relationships for them.

Create MEASURE.

CALCULATE(
SUM(NetSales[Volume]),
FILTER(
'NetSales'.
NetSales[Material#] = "A" &&
NetSales[Customer ID] IN VALUES('Lead'[Customer ID]) &&
)
)

If the results obtained are not what you expected. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

Best Regards,

Clara Gong

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

Community Support

Hi @shayla,

As per your description, I have created two tables and created relationships for them.

Create MEASURE.

CALCULATE(
SUM(NetSales[Volume]),
FILTER(
'NetSales'.
NetSales[Material#] = "A" &&
NetSales[Customer ID] IN VALUES('Lead'[Customer ID]) &&
)
)

If the results obtained are not what you expected. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

Best Regards,

Clara Gong

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors