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

## Cumulative measure with inactive relationship between 2 fact tables

Hello all!

I have two fact tables that have no active relationship. I need to take the sum of the quantity in one of them (transactions) and take it to the other (quote) --> this last have the Close price of different stocks. I need the quantity of the other table to multiply quantity * price.

I was able to get the quantity using ALLRELATIONSHIP and  it works fine, but the accumulative measure is not working. I'm using this:

Accumulated Stock Qty =

CALCULATE(
[UR Stock Qty],
FILTER(
ALL(
'Calendar'),
'Calendar'[Fecha] <= MAX('Calendar'[Fecha]
)))
I'm copying a link to the PBI file so you can see it below:

https://1drv.ms/u/s!AvSFZ2hooRIDgdgFkvrnNGCtXLqlRQ?e=hYwdF1

Hope you can help me with this.

3 REPLIES 3
Super User

@AndresOHV , First create a measure with userelationship and then use it in the same formula, that should work

example

New Qty = calculate(Sum(Table[Qty]), userelationship(Table[Date], Date[Date]))

Accumulated Stock Qty =
CALCULATE(
[New Qty],
FILTER(
ALL(
'Calendar'),
'Calendar'[Fecha] <= MAX('Calendar'[Fecha]
)))

New Member

I forgot to mention, the relationship is between 2 fact tables, not between a fact table and calendar.

New Member

Hello @amitchandak

That's exactly what I'm doing, the first measure works fine but when I try to use the accumulated measure it doesn't work. It shows the same number as the new Qty measure.
Sorry I'm answering from a different account right now.

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.