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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AndresOHV
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
amitchandak
Super User
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]
)))

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

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors