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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Silver75
Frequent Visitor

How can I sum revenue between two date in different table?

Hi all,

I have to sum for each ID the revenue in fact table with date greater than date in dimension 1

The two tables have a secondary relationship.

How can I resolve, please?

Thank you

I have attached an example with target of dax (REVENUE_MEASURE)

 

 

tables.jpg

 

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Silver75,

In your result table, the REVENUE sum should be 70 rather than 20, because 2015/10/10 is also greater than 2015/02/15 for ID 2. I try to reproduce your scenario and get expected result.

For your source table, create a one(FACT) to many(dimension) relationship as the screenshot below, right?

1.PNG

Then create a measure using the formula.

REVENUE_Measure = CALCULATE(SUM('FACT'[REVENUE]),FILTER(ALLEXCEPT('FACT','FACT'[ID]),'FACT'[DATE_ORDER]>RELATED(Dimension1[DATE])))


Finally, create a table visual, select the ID as axis level, the measure as value, you will get result, please see the following screenshot.

2.PNG

If you have any question, please let me know.

Best Regards,
Angelia




Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.